title: Flex: Problems using scale9Grid with Image
body: <p>I'm trying to create an image component that can be scaled using 9-slice scaling.</p>
  
  <p>I'm 100% positive the grid rectangle is inside the image's bounds. However, the scale9Grid property seems not to affect anything.</p>
  
  <p>I have tried many different things. Here is my last attempt where I try to put the image in a canvas. Any idea what I'm doing wrong?</p>
  
  <p>mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
      creationComplete="init()"
      ></p>
  
  <pre><code>&lt;mx:Script&gt;
      &lt;![CDATA[
          import mx.core.BitmapAsset;
          import mx.controls.Image;
  
          [Embed(source="assets/image.png")]
          private var barImageClass:Class;
          private var barImage:Image;
  
          private function init():void
          {
              barImage = new Image();
              barImage.addChild( new Bitmap( (new barImageClass() as BitmapAsset).bitmapData ) );
  
              barImage.scale9Grid = new Rectangle( 120, 4, 2, 2 );
  
              barImage.scaleX = 2;
  
              addChild( barImage );
          }
      ]]&gt;
  &lt;/mx:Script&gt;
  </code></pre>
  
  <p></p>