Jump to content
Search Community

[solved] retrieving multiple copies of image from LoaderMax

overbyte test
Moderator Tag

Recommended Posts

answer

 

get the images rawContent (should be a bitmap if there were no security sandbox issues) then use it's data property to get a BitmapData object which you can then use in as many bitmaps as you want.

 

i ended up doing something quite similar but using bitmapdata.draw() from the content instead:

 

public function getImageById(id:String):Bitmap
{
if (!retrievedItems[id])
{
	retrievedItems[id] = LoaderMax.getContent(id);
}

var item:DisplayObject = retrievedItems[id];
var bmd:BitmapData = new BitmapData(item.width, item.height, true, 0);
bmd.draw(item);

return new Bitmap(bmd, "auto", true);
}

 

obie

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...