Scale an Image with Embed setting : Image Scale « Graphics « Flex






Scale an Image with Embed setting

Scale an Image with Embed setting
           


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
    
    
     <mx:Script>
        
            [Embed(source="logo.png", scaleGridTop="5", scaleGridBottom="10", scaleGridLeft="5", scaleGridRight="10")]
            [Bindable]
            public var imgCls:Class;
      
    </mx:Script>
    
    <mx:Label text="Original Image" />
    <mx:Image source="@Embed('logo.png')" />

    
    <mx:Spacer height="10" />
    <mx:Label text="Scale9-Scaled Image" />
    <mx:Image source="{imgCls}" width="100" height="100"/>
    
</mx:Application>

   
    
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Scale an image by setting its width and heightScale an image by setting its width and height
2.BitMap ScalingBitMap Scaling
3.Using postLayoutTransformOffsets property to modify the position and scale of a component.Using postLayoutTransformOffsets property to modify the position and scale of a component.
4.Using 9-slice scaling to maintain a set border, regardless of how the image itself is resized.