2 Replies Latest reply on May 5, 2008 11:07 AM by slaingod

    Resize Bitmap image in image control in flex3

    mousumi_78
      I am loading an image in image control initially. Then I am applying color transform to that image and want to load that bitmap image in flex3. That is working, but automatic resize is not working then. If I load another image then auto resize is working fine. Doesnt Image control support resizing of bitmap object of same image?.

      Here is the portion of code:
      <mx:Image source="{imgpath}" id="myImage" creationComplete="imageCompleted();" x="20" y="30" width="365" height="440" maintainAspectRatio="true"
      />
      private function applyColor(event:Event):void{

      myBitmapDataObject = new BitmapData(myImage.width, myImage.height, true, 0x00CCCCCC);

      myBitmapDataObject.draw(myImage.content);
      myBitImage = new Bitmap(myBitmapDataObject);

      myBitmapDataObject.colorTransform(myBitmapDataObject.rect, new ColorTransform(1, 1, 1, 1, 39, 76, 135, 100));
      myImage.removeChildAt(0)
      myImage.load(myBitImage);


      }

      Any help is appreciated.