Yeah, the problem is that the Canvas container only allows children that
implement IUIComponent. It would have been real nice if Adobe had provided a
"raw" container that did no layout of its children (but implemented
IUIComponent itself), but they didn't.
Fortunately, Grant Skinner has provided just such a container...
DisplayObjectWrapper. Check out his blog or Google for it.
If you wrap your Bitmap with the DisplayObjectWrapper first you'll then be
able to add it (or rather, the DisplayObjectWrapper) to the canvas.
Troy.
On 21 Mar 2007 08:18:46 -0700, tosadavemgr <[EMAIL PROTECTED]> wrote:
I have a canvas in my layout and the application allows dragging and
dropping items into the canvas. I need to be able to grab a bitmap of
the canvas when the user is finished, so I can display the drawing on
another panel, and in the FlexPrintJob function.
I've tried using this code, initiated from a button:
private function myDrawing():void{
var myBitmapData:BitmapData = new BitmapData(530, 445);
myBitmapData.draw(myWorkspace1);
var bmp:Bitmap = new Bitmap(myBitmapData);
showDrawing.addChild(bmp); //this isn't working
}
myWorkspace1 is the ID of the canvas where everything is dropped.
I have a canvas with the ID=showDrawing that I'd like the bitmap to
appear in.
Anyone know what I need to add to the above function to get that done?
Dave