Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
rob.roberts

Save Bitmap question

Recommended Posts

I am currently replacing my own image rotate and scale functions with TransformManager. My application adds items to layers which are in turn children of a custom, masked stage. Since they must now be children of the TransformManager, how exactly would I convert the current view of the TransformManager to a bitmap since it's not a movieClip? I current perform an imageData.draw using the movieClip picStage to dump all its view data to a jpg image.

 

Thanks.

 

Rob Roberts

Link to comment
Share on other sites

What do you mean by "since they must now be children of the TransformManager"? TransformManager is just code that manages things - it's not a DisplayObjectContainer, so it doesn't have any children. You should be able to BitmapData.draw() however you please.

Link to comment
Share on other sites

What do you mean by "since they must now be children of the TransformManager"? TransformManager is just code that manages things - it's not a DisplayObjectContainer, so it doesn't have any children. You should be able to BitmapData.draw() however you please.

But since nothing is on the stage or a child of another DisplayObject, I was trying to figure out how to BitmapData.draw() my stack from the top view (basically I expect to have 15-20 objects stacked in my TransformManager instance, at various angles of rotation and placement.) I want to draw what I seen in my "masked" screen view without drawing my screen objects, which I currently do by using BitmapData.draw on my picStage1 object (a movieClip holding everything else.)

I'll have to experiment with simpler examples first and re-code by process using TransformManager.

 

Thanks.

 

If anybody has an example, I'd love to see how you are doing it.

Link to comment
Share on other sites

  • 3 weeks later...

Hey Rob

 

I've done a number of projects that sound similar to what you're doing, i.e. masking off an area where you allow the user to re-arrange a bunch of arbitrary DisplayObjects using TransformManager, and then allow them to save off the arrangement as a JPG or whatever.

 

I'm also a bit confused about where you're confusion is coming from!

 

You can store your DisplayObjects in a standard DisplayObjectContainer in whatever way you were before, and just do a BitmapData.draw() on that DisplayObjectContainer in the normal way.

 

Whether you're adding those items to a TransformManager instance as well doesn't really effect this setup. When you add an item to TransformManager you're not adding it to a display list, TransformManager isn't a DisplayObjectContainer ...

Link to comment
Share on other sites

Jed:

So you're saying that I can still add my objects to the stage (or other display object) AND use TransformManager.addItem for these graphics to be managed by TM? I hadn't thought about it that way, as members of 2 different "collections." I honestly thought if I did it that way, the image would logically show up twice.

 

I currently add my items to a movie clip that is masked and manage each object's rotation, scale, etc. through my own events. When the user saves, I dump the movieclip to a bitmap object and save as a jpg. It sounds like you are saying I can still do that, but add the items to the transform manager to handle the rotation, etc. That would be ideal.

Link to comment
Share on other sites

Yep, that's exactly right, what you need to do is add your items to both "collections", TM and the MovieClip. You add your items to the MovieClip (as before) in order for them to show up in Flash's display list and render on screen, and you add your items to TM in order for TM to inject/manage the transformation interactivity etc. Although TM manages and manipulates DisplayObjects it has nothing to do with actually rendering them on the display list.

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.
×