Hello all,
I am trying to take a snapshot of the masked region of an image... so, I load my image then perform the following functions:
private function manageLoadedImage(e:Event):void
{
_bitdata = e.currentTarget.content; // get the bitmap
_bithold.addChild( _bitdata ); // add the bitmap to a sprite on the stage
_bithold.x = holder1.x -((_bithold.width - holder1.width)/2); // center image
_bithold.y = holder1.y -((_bithold.height - holder1.height)/2); // center image
var m:Shape = new Shape(); // create the shape
m.graphics.beginFill(0x0); // make the fill
m.graphics.drawRect( this.x, this.y, holder1.width, holder1.height ); // draw the mask
m.graphics.endFill(); // end the fill
_bithold.mask = m; // mask the image
}// private function manageNewPaneAddition(e:Event):void
public function save( ):void
{
// WHAT DO I DO HERE ????????
_bmdsrc = new BitmapData( holder1.width, holder1.height ); // create the new bitmapdata
var m:Matrix = _bithold.transform.matrix; // lets try this out
m.tx = -holder1.x + _bithold.width; // not sure what this means ?
m.ty = -holder1.y + _bithold.height; // what does this mean ?
_bmdsrc.draw( _bithold, m); // draw the bitmapdata
// END PROBLEM ??????????????
}// private function save( ):void
So, after I manage the loaded image, I save it. But the save function only outputs a white square 80x80px. This tells me that I am snapshot-ing a blank stage.
The MovieClip construction is as follows:
I have a movie, inside that movie I have a thumbnail editor name ThumbEdit.
ThumbEdit has a movieclip on its stage called "holder1". In the document class of ThumbEdit I create a sprite "_bithold" and place it on the stage at holder1.x and holder1.y. When the image loads, I add the image to _bithold and then mask _bithold with a shape. So, I want to grab a snapshot of the masked region of _bithold but I'm not sure how I should go about doing that... any advice?
Thanks for your time. nG