I'm trying to create a copy of a DisplayObject as a Bitmap and add the resulting Bitmap in to a Canvas object.
Here is my code:
*Note - value is the variable containing the DisplayObject
Code:
var bitmap:Bitmap = new Bitmap();
bitmap.bitmapData = new BitmapData(value.width, value.height, false, 0x000000);
bitmap.bitmapData.draw( value, null, null, null, null );
var image:Image = new Image();
image.addChild( bitmap );
image.width = this.width;
image.height = this.height;
this.addChild(image);
The problem that I am encountering is that the Canvas I am adding the Image object to is displaying a blank area and does not contain the DisplayObject.
Any help is greatly appreciated.