« Flash Player 10 Debug is Out
» Flex Builder 3.0.1 Update (includes Flex SDK 3.1)

ActionScript, How to

How To Make a BitmapData From a DisplayObject/UIComponent

Andrei Ionescu | 20.08.08 | 5 Comments

Today I needed to found a way to create bitmap data object from a display object. I found a solution in Flex Cookbook (http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postId=1682) and having this I improved it and made it simpler.

The code follows…

public function makeBitmap(myDO:DisplayObject):BitmapData 
{
    var myBD:BitmapData = new BitmapData(myDO.width, myDO.height);
    myBD.draw(myDO);
    return myBD;
}

This is all of it. Isn’t is simple?

Share and Enjoy:
  • Technorati
  • StumbleUpon
  • del.icio.us
  • NewsVine
  • Reddit
  • Digg
  • Furl
  • co.mments
  • blogmarks
  • Slashdot
  • description
  • Taggly
  • YahooMyWeb
  • connotea
  • Webride




Tags: ,

This post was written by Andrei Ionescu

Views: 2058

related

5 Comments

have your say

Add your comment below, or trackback from your own site. Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="">

:

:


« Flash Player 10 Debug is Out
» Flex Builder 3.0.1 Update (includes Flex SDK 3.1)