The aspect ratio of an image is the ratio of its width to its height. For example, a standard NTSC television set uses an aspect ratio of 4:3, and an HDTV set uses an aspect ratio of 16:9. A computer monitor with a resolution of 640 by 480 pixels also has an aspect ratio of 4:3. A square has an aspect ratio of 1:1.
All images have an inherent aspect ratio. When you use the height and widthproperties of the Image<http://127.0.0.1:60363/help/topic/com.adobe.flexbuilder.help/langref/mx/controls/Image.html>control to resize an image, by default Flex preserves the aspect ratio of the image so that it does not appear distorted. By preserving the aspect ratio of the image, Flex might not draw the image to fill the entire height and width specified for the <mx:Image> tag. For example, if your original image is a square 100 by 100 pixels, which means it has an aspect ratio of 1:1 On Mon, Nov 30, 2009 at 4:08 PM, ganaraj p r <ganara...@gmail.com> wrote: > I was wondering if this was a bug with flex or if I was doing something > totally wrong. > > The amount of code in this is extremely low, so , I was guessing that there > was nothing wrong from my part. > > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > layout="absolute"> > <mx:Image id="myimage" maintainAspectRatio="true" > horizontalCenter="0" verticalCenter="0" > source="@Embed(source='images.jpg')" > scaleContent="true" width="100%" height="100%"/> > </mx:Application> > > > This is all the code there is in this application ( I am attaching the app, > for your reference ) . > My expectation from this code is that the image should fit the screen, > maintain the aspect ratio of the image and finally be both centered > horizontally and vertically! > > > Can someone help me out in this ? > > -- > Regards, > Ganaraj P R > > -- > You received this message because you are subscribed to the Google Groups > "Flex India Community" group. > To post to this group, send email to flex_in...@googlegroups.com. > To unsubscribe from this group, send email to > flex_india+unsubscr...@googlegroups.com<flex_india%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/flex_india?hl=en. > -- Thanks & Regards, Nagendra D Bhange Software Engineer Mob: +91 9920768047 -- You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to flex_in...@googlegroups.com. To unsubscribe from this group, send email to flex_india+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.