Import from rect
Richard Gaskin
ambassador at fourthworld.com
Fri Jan 16 12:33:18 EST 2009
Thomas McGrath III wrote:
> I have the following line of code in a stack which works great but
> seems to me to be wrong:
>
> import snapshot from rect (the rect of img "TEST2") of card "Test" of
> stack "Tester" -- Works as expected
>
> So if I fix it to what I think it should be it doesn't work but
> snapshots from the actual stack or card but not the rect of the image:
>
> import snapshot from rect (the rect of img "TEST2" of card "Gradient
> Lab" of stack "LRSGradientText") -- Does not work as expected
>
> Any ideas or the obvious answer that I might be missing. Example one
> does work and I am using it but every time I go through my code I try
> to 'fix' it with example two and then it doesn't work. This is the
> fifth time I broke it trying to fix it..... But it ain't broke......
Offhand I don't know why the latter isn't working, but you might
consider using the new form of "export snapshot" which allows you to
specify the object rather than merely its rect:
export snapshot from grp "MyGroup" to file "MyImage.jpg" as jpeg
This will cause the object specified to be rendered into an offscreen
buffer directly, then that buffer is compressed into the specified
format for writing to disk.
The benefit here may be that the card on which the object resides
doesn't even need to be opened to get its image exported.
HTH -
--
Richard Gaskin
Fourth World
Revolution training and consulting: http://www.fourthworld.com
Webzine for Rev developers: http://www.revjournal.com
More information about the use-livecode
mailing list