Jump to content
Search Community

selectedItems index & ImageSnapshot - to capture for XML

mprout1 test
Moderator Tag

Recommended Posts

Is there a method to capture the state of the TransformManager so that it can be reloaded when the site is revisited? Could this be done by looping through the selectedItems index and using the "ImageSnapshot.captureImage()" method. The image would be saved to disk and referenced through XML. This in addition to image coordinates, could reload the TransformManager.

 

ImageSnapshot

Link to comment
Share on other sites

I'm not familiar with ImageSnapshot.captureImage(), but sure, it should be pretty easy to loop through the TransformManager's targetObjects Array and record their transform.matrix values (a, b, c, d, tx, and ty) so that you could store those in an XML file (or wherever) and re-apply them later.

Link to comment
Share on other sites

I'm not familiar with ImageSnapshot.captureImage(), but sure, it should be pretty easy to loop through the TransformManager's targetObjects Array and record their transform.matrix values (a, b, c, d, tx, and ty) so that you could store those in an XML file (or wherever) and re-apply them later.

have an example of how to get those values? ( the for loop needed to get them )

 

thanks!

Link to comment
Share on other sites

I'm not sure exactly how you want to store them, but here's an example that creates a "data" array with an object for each targetObject, containing all the matrix data (a, b, c, d, tx, and ty):

 

var targets:Array = myManager.targetObjects;
var m:Matrix;
var data:Array = [];
for (var i:int = 0; i 	m = targets[i].transform.matrix;
data.push({a:m.a, b:m.b, c:m.c, d:m.d, tx:m.tx, ty:m.ty});
}

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