I am in an urgent need of help!
I’ve spent hours and hours on this problem, but I don’t even have a clue on how to dot it…
I’m doing a digital camera simulation : the user is presented with a big background, he have to take a partial snapshot of that background. As with any camera, he can Zoom in/Zoom out and rotate.
I use a Bitmapdata class to save the snapshot he takes, it works (with a bit of hack) when I don’t move the background. But when I Zoom/Rotate the background, **the snapshot is still taken from the original background! ** As if I didn’t do any modification.
I’m thinking about [COLOR=“Navy”]using a rotation and scale matrix [/COLOR] then apply it to the bitmap data, but I don’t know what values to put in those matrix. I’m helpless in math.
Please help!
Here’s the code
function capture(nr) {
var myMatrix:Matrix = new Matrix();
snapshot = new BitmapData(follow._width, follow._height);
myMatrix.rotate(-1*photo1_mc._rotation); // Tried this for the rotation but it didn't work
var translateMatrix:Matrix = new Matrix();
translateMatrix.translate(-1*(follow._x-580), -1*(follow._y-423)); // translation matrix to translate the whole photo.b
myMatrix.concat(translateMatrix);
snapshot.draw(photo1_mc, myMatrix);
capture_mc.attachBitmap(snapshot, 1);
}
and here’s the FLA :
Bitmap FLA