Hi,
I am converting an image to bitmap and trying to draw it on top level canvas.
But it is not visible. Is there any other way or suggestion to do so ??
--------------------------------------------------------------
<mx:HBox width="780" height="545">
<mx:Canvas id="apiImgCanvas" y="10" width="780" height="100%"
<mx:Image id="imgBg" y="20" width="740" height="100%"/>
<mx:Canvas id="usrImgBkgroundCanvas"
x="{usrImgCanvas.x}" width="{usrImgCanvas.width}"
height="{usrImgCanvas.height}"
mouseEnabled="false" mouseChildren="false"
borderStyle="solid"
borderThickness="0">
</mx:Canvas>
<mx:Canvas id="usrImgCanvas"
dragComplete="UserImage.dragCompleteHandler(event)"
mouseMove="changeCursor(event);"
mouseOver="changeCursor(event);"
mouseOut="changeCursor(event);"
height="100%">
</mx:Canvas>
<mx:Image id="imgFg" x="0" y="92" width="780" height="100%"/>
</mx:Canvas>
</mx:HBox>
----------------------------------------------------------------
Under as Script
var request:URLRequest = new URLRequest(FileInfo.getUserImgPath());
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
image_completeHandler);
imageLoader.load(request);
------------------
public function image_completeHandler(event:Event):void{
var bmd:BitmapData = Bitmap(event.currentTarget.content).bitmapData;
bmd.draw(usrImgCnavas);
usrImgCanvas.graphics.beginBitmapFill(bmd);
usrImgCanvas.graphics.drawRect(0, 0, usrImgCnavas.width, usrImgCanvas.height);
usrImgCanvas.graphics.endFill();
also tried
userBmpImage = new Bitmap(bmd);
usrImgCanvas.addChild(userBmpImage);
Any help is appreciated.