Create an Image from a Bitmapdata


(josepho) #1

Hi there, i have been searching a lot and Im not able to guess how to do it. Can anybody tell me if there is a way to convert a bitmapdata in an image? Or to draw the pixels of a bitmapdata in an image??

Many thanks!


(Zachary Lewis) #2

If you want access to the BitmapData, you can get a reference to it with Image.source.

var myImage:Image;
var myBitmapData:BitmapData = myImage.source;

(Andrew Preston) #3

This doesn’t work. Image does not have a property called “source”. See documentation here: http://useflashpunk.net/docs/net/flashpunk/graphics/Canvas.html


(Jacob Albano) #4

That’s the Canvas class, not the Image class. Image does have a source property, but it’s protected for some reason.