Export Snapshot

Sarah Reichelt sarah.reichelt at gmail.com
Thu Feb 16 22:28:15 EST 2006


On 2/17/06, Marty Knapp <martyknapp at comcast.net> wrote:
> I'm tinkering with the snapshot command for the first time and something
> isn't clicking with me. Here's my script:
>
> on mouseUp
>   ask file "Save image as:"
>   export snapshot from rect(the rect of graphic "BS") to file it as JPEG
> end mouseUp
>
> I get a file that my Mac thinks is a text file, though I can open it in
> Photoshop.

Insert this line before saving:
  set the fileType to empty

By default, the filetype is set to "ttxtTEXT" which sepcifies a text
file, but if you set it to empty before writing a file, Finder will
work out the file type using the extension. You may want to include a
check for the ".jpg" extension in the file name before saving.

> I can probably live with that, but instead of getting the
> portion of my stack window I want, I get coordinants absolute to my
> screen (of the right proportions). Everything else I've tried gets an
> error. Do I need to do a calculation of my object/window relative to the
> screen rect or what am I missing?

>From the docs for "export snapshot":

"Important!  If a window is specified, the rectangle is given in
relative (window) coordinates; otherwise, it is given in absolute
coordinates."

>
> I'm using a trial of 2.7 (boy is it buggy!)

I have found the release version to be very good. What areas are you
having problems with?

Cheers,
Sarah



More information about the use-livecode mailing list