Snap-shotting around

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10102
Joined: Fri Feb 19, 2010 10:17 am

Snap-shotting around

Post by richmond62 » Sun Nov 08, 2015 9:24 am

This message is my response to a thread on the Use-List about taking screen shots of stacks that are off screen.

This sounds very odd as, surely, EXPORT SNAPSHOT exports a snapshot of whatever is inwith the rect or object defined.

I wonder if, instead of doing export snapshot from stack xxx you might not be better doing export snapshot from card zzz: my experience
of doing the thing from the stack has not been altogether satisfactory . . . Oops . . . haven't tried that since DreamCard 2.6 (remember
that???): just tried export snapshot from stack xxx and it "threw a bluey", so I don't know what you are doing.

However, export snapshot from card zzz does a perfectly respectable job.
splatCARD.png
On screen snapshot
splatCARD.png (144.36 KiB) Viewed 4022 times
When moved off screen:

on mouseUp
set the moveSpeed to 65000
move stack "splat" to -400, -400
wait 10 ticks
export snapshot from card id 1002 of stack "splat" to file "splatCARDoffScreen.png" as PNG
wait 10 ticks
move stack "splat" to 400, 400
end mouseUp
splatCARDoffScreen.png
Off screen snapshot
splatCARDoffScreen.png (147.58 KiB) Viewed 4022 times
it does just as good a job as on screen.
Last edited by richmond62 on Sun Nov 08, 2015 8:58 pm, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10102
Joined: Fri Feb 19, 2010 10:17 am

Re: Snap-shotting around

Post by richmond62 » Sun Nov 08, 2015 1:03 pm

Trying to do the same sort of thing with the stack's windowID is a pig's breakfast:

on mouseUp
set the moveSpeed to 65000
move stack "splat" to -400, -400
wait 10 ticks
put the windowID of this stack into WINDAE
export snapshot from stack WINDAE to file "splatCARDoffScreenWID.png" as PNG
wait 10 ticks
move stack "splat" to 400, 400
end mouseUp

here's my result:
splatCARDoffScreenWID.png
splatCARDoffScreenWID.png (1.05 KiB) Viewed 3996 times
which is a load of old cobblers.

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Snap-shotting around

Post by [-hh] » Sun Nov 08, 2015 3:25 pm

Just to confirm your arguing, Richmond.

I also use "export snapshot" with LC 6-8 after setting top or left of objects 20000 pixels off the main screen (5000 is today not enough for a large multiple monitor arrangement), also for *hidden* objects, also "with effects".

But one should have one thing in mind when going "offset":
Coordinate values are limited to the range -32768 to 32767,
see quality center #11639.
shiftLock happens

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Snap-shotting around

Post by jacque » Sun Nov 08, 2015 5:27 pm

The window id is an integer, so you are telling LC to take a snapshot of a stack located by its layer order. Try using the stack name instead.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10102
Joined: Fri Feb 19, 2010 10:17 am

Re: Snap-shotting around

Post by richmond62 » Sun Nov 08, 2015 8:47 pm

Possibly that attempt had something to do with a remark posted on the Use-List:

"I wonder if it would be possible to pass the window ID of a hidden stack?"

And, unless I'm much mistaken . . .

If I do this:

on mouseUp
put the windowID of this stack into WINDAE
export snapshot from stack WINDAE to file "splatCARDoffScreenWID.png" as PNG
end mouseUp

when the stack is NOT off screen I get a "perfectly respectable" screen shot of the stack!
splatCARDoffScreenWID.png
splatCARDoffScreenWID.png (134.99 KiB) Viewed 3923 times
Attachments
splat.zip
Here's the stack to play with.
(182.47 KiB) Downloaded 193 times

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Snap-shotting around

Post by jacque » Mon Nov 09, 2015 2:49 am

Right, that remark was in response to the OP on the list who said he was using an external that required a window ID, so I suggested passing the ID to a hidden stack rather than the one that was visible.

I wasn't at my computer when I answered your post here, so I sidestepped and said "try it". ;) It looks like the engine is translating your command to use the window rect, which would match what you're seeing.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply