easy question

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
adventuresofgreg
Posts: 349
Joined: Tue Oct 28, 2008 1:23 am
Contact:

easy question

Post by adventuresofgreg » Fri Dec 30, 2011 5:33 pm

Hi - I know the answer is obvious, but I cant figure it out. How do I reference an imported snapshot?

import snapshot from rect therect of window theID

Once the snapshot is there, it is named with an image ID:

image id 1267

Klaus
Posts: 14212
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: easy question

Post by Klaus » Fri Dec 30, 2011 5:42 pm

Hi Greg,

last image :-)

...
import snapshot from rect therect of window theID
set the short name of last image to "new name of screenshot"
...


Best

Klaus

adventuresofgreg
Posts: 349
Joined: Tue Oct 28, 2008 1:23 am
Contact:

Re: easy question

Post by adventuresofgreg » Fri Dec 30, 2011 6:04 pm

Thanks Klaus! That was easy.

Klaus
Posts: 14212
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: easy question

Post by Klaus » Fri Dec 30, 2011 6:54 pm

adventuresofgreg wrote:Thanks Klaus! That was easy.
Yep, you already mentioned this :D

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10356
Joined: Wed May 06, 2009 2:28 pm

Re: easy question

Post by dunbarx » Fri Dec 30, 2011 8:12 pm

What Klaus said.

This use of the keyword "last" is invaluable in all sorts of similar cases, where the only distinguishing property of an object is that it was created/imported last. The trick is to grab it and modify as soon as possible, so it doesn't get away.

Note that this trick is NOT stable when referring to groups.

Craig Newman

adventuresofgreg
Posts: 349
Joined: Tue Oct 28, 2008 1:23 am
Contact:

Re: easy question

Post by adventuresofgreg » Sat Dec 31, 2011 1:31 am

next issue: I want to take a snap shot of a plot that has been changed with a script, but the snapshot won't wait until the new graphic has been drawn - it always exports a snapshot of the old image.

For example,

set the points of graphic myoldgraphic to mynewgraphic
import snapshot from rect therect of window theID

This always makes a snapshot the myOLDgraphic, not myNEWgraphic. I tried inserting a wait with messages, but that also does not work.

Any ideas?
Thanks Klaus

Greg

Post Reply