Maintain Image Aspect Ratio : Image « Graphics « Flex






Maintain Image Aspect Ratio

Maintain Image Aspect Ratio
            

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
    
    
    <mx:Spacer height="10" />
    <mx:Label text="Scaled Image" />
    <mx:Image source="@Embed('logo.png')" width="100" height="100"/>
    <mx:Image source="@Embed('logo.png')" width="100" height="50" maintainAspectRatio="false"/>
    
    
</mx:Application>

   
    
    
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Use inline item renderer to display imageUse inline item renderer to display image
2.Bind Image to a variableBind Image to a variable
3.Explicit sizing for the Image control and default sizing for the Button controlExplicit sizing for the Image control and default sizing for the Button control
4.uses explicit sizing for the Image control and default sizing for the Button controluses explicit sizing for the Image control and default sizing for the Button control
5.Change Image source in button actionChange Image source in button action
6.Image as Button skinImage as Button skin
7.When the user clicks the button, the action sets the visible property of the image to true to make it appear
8.Use load() method to replace a small image with a large image when the user clicks a buttonUse load() method to replace a small image with a large image when the user clicks a button
9.Using GIF file as both a skin for the Button control and a source for the tag
10.Embedding three images and applies those images as skins to an instance of a Button controlEmbedding three images and applies those images as skins to an instance of a Button control
11.Button with Embedded imageButton with Embedded image
12.Add image based border skin for CanvasAdd image based border skin for Canvas
13.Load image from a URLLoad image from a URL
14.Working with different media typesWorking with different media types
15.Setting visibilitySetting visibility
16.Import a green square from a SWF file that contains a library of different shapes
17.Resize logo to the exact values of the height and width properties without regard for its aspect ratioResize logo to the exact values of the height and width properties without regard for its aspect ratio
18.Assigning an image to a variable to decouple its locationAssigning an image to a variable to decouple its location
19.Use Image control to display imageUse Image control to display image
20.Use a relative path to reference an image in an assets directoryUse a relative path to reference an image in an assets directory
21.Reference an image using a URLReference an image using a URL
22.Create image thumbnailsCreate image thumbnails
23.Set height and width of the image to 150 by 200 pixelsSet height and width of the image to 150 by 200 pixels
24.Resize Image to exact height and widthResize Image to exact height and width
25.x and y properties specify the upper-left corner of imagex and y properties specify the upper-left corner of image
26.Use ActionScript to set image propertiesUse ActionScript to set image properties
27.Use load() method to replace imageUse load() method to replace image
28.Text can flow around the imageText can flow around the image
29.Layout images in a CanvasLayout images in a Canvas
30.Png image based skinPng image based skin
31.Use Image control in an MXML fileUse Image control in an MXML file
32.skin based on png imagesskin based on png images
33.Do not maintain Aspect Ratio when displaying image with ImageDo not maintain Aspect Ratio when displaying image with Image
34.Use source for Image controls and other controls that point to an external fileUse source for Image controls and other controls that point to an external file
35.Compare Two Bitmap ImagesCompare Two Bitmap Images
36.Image source fileImage source file
37.Load image file for an Image control with load methodLoad image file for an Image control with load method
38.Image control io error
39.Image BindingImage Binding
40.Image DemoImage Demo
41.Set Image Source to change image file for an Image controlSet Image Source to change image file for an Image control
42.Load Image With Load method from a disk fileLoad Image With Load method from a disk file
43.Move ImageMove Image
44.Load image with Loader and Paint image with graphics
45.Display Images and SWFs in HTMLDisplay Images and SWFs in HTML
46.Load and Display an ImageLoad and Display an Image
47.Display a Custom Loader while Loading ImagesDisplay a Custom Loader while Loading Images
48.skin with imageskin with image
49.Use the backgroundImage style to specify an image as the background of the containerUse the backgroundImage style to specify an image as the background of the container
50.Access a JPEG image at run timeAccess a JPEG image at run time
51.Reference an image by using a URLReference an image by using a URL
52.By specifying a height and width of 20 by 20 pixels, you create a thumbnail of the image.By specifying a height and width of 20 by 20 pixels, you create a thumbnail of the image.
53.Load a simple image from a local locationLoad a simple image from a local location
54.Using the tag and how text can flow around the imageUsing the <img> tag and how text can flow around the image
55.Use @Resource directive anywhere a String might supply the location of the image.
56.Set image transform center to the right edge, corresponding to the transormX property having a value of 100Set image transform center to the right edge, corresponding to the transormX property having a value of 100
57.Image ClassImage Class
58.Read and Save a User's Webcam ImageRead and Save a User's Webcam Image
59.Embed a JPEG image into a Flex applicationEmbed a JPEG image into a Flex application