Autofile snapshots
Ken Norris
pixelbird at interisland.net
Mon Mar 24 23:17:01 EST 2003
***********
> Date: Mon, 24 Mar 2003 20:52:21 +0100
> Subject: Re: Autofile snapshots
> From: =?ISO-8859-1?Q?Bj=F6rnke_von_Gierke?= <bvg at mac.com>
>
>> on mouseDown
>> rectSet -- This handler sets the group's rect to the rect of the
>> button
>> show group "kybdDN"
>> import snapshot from the rect of me
>> -- Is supposed to take a picture of the button in it's 'down' state
>> to use
>> -- as an icon later when he whole process is done.
>> end mouseDown
>
> I tested your script and the problem is that you did not read the
> manual ;-)
----------
Well I did, I just didn't type it quite right. I can't see the dictionary
window while I'm typing into a script editor and visa versa, to make
comparisons, but I finally see the difference in the syntax now. This has
been a major problem for me. I'm always missing stuff when toggling back and
forth through the windows. I'm going to set up another computer to view the
docs when I get enough space.
----------
> here is a script that works, inclusive exporting and deleting:
> on mouseDown
> hide me
> -- So the button will not cover the group
----------
It won't, not visually anyway. It's transparent. Nothing I've read indicates
I have to "uncover" something which is visible anyway.
----------
> rectSet
----------
The above is a handler that sets the rect and scroll of the group to the
rect, top, and left of the button of only that part of the group, which
exactly matches it to the button position and size.
----------
> show group "kybdDN"
----------
....shows the image I actually want to get the picture of.
----------
> set the name of the templateImage to "exportMe"
> -- Needed to export it later
----------
'templateImage' is a brand new term to me, i.e., I haven't seen it before,
wasn't aware of its existence.
Thanks for bringing it up.
----------
> import snapshot from rect ( the rect of me ) of window (the windowID
> of this stack)
> --you must specify a window, or the screen will be used
> --Also note differences in syntax to your code
----------
Yep, I forgot to include the window id, which determines the coordinates
from the window rather than the screen, a very cool feature.
----------
> export image "exportMe" to file "exported.jpg" as JPEG
> --Exports as jpg into the defautlFolder, beware of Apple resources!
----------
Yeah, well I'll probably put the images in a folder inside the folder with
the stack, like the other images (full filepath).
> delete image "exportMe"
> show me
> --Clean up
> end mouseDown
----------
Thanks so much for your script.
BTW, just so you know, we're receiving your "From" line with spurious stuff.
It looks like this (c&p'd from the digest):
From: =?ISO-8859-1?Q?Bj=F6rnke_von_Gierke?= <bvg at mac.com>
Best regards,
Ken N.
More information about the use-livecode
mailing list