export jpeg frustration

Klaus Major klaus at major-k.de
Wed Apr 13 07:13:18 EDT 2005


Hi Chris,

actually the " export snapshot from rect pRect of window WinId ..." did 
never work for me :-(
Don't know why...

I use "globalloc" instead:

...
put the ticks & "temp.jpg" into tFile
put globalloc (the topleft of grc "PFFrame") into obenlinks
## german for topleft :-)
put globalloc (the bottomright of grc "PFFrame") into untenrechts
## german for...you guess :-)

export snapshot from rect (obenlinks,untenrechts) to file tFile as JPEG


> Hello folks.
>
> Can anyone shed any light on this?  I'm having problems with the 
> export syntax.  I am trying to export an area of a window...
> The snippet below works fine, happily creating a jpeg in the default 
> folder, but using screen coords (which I don't want)
>        put the ticks & "temp.jpg" into tFile
>        put the rect of graphic "PFrame" into pRect
>        put the id of this wd into WinId
>        put prect && winId && defaultfolder && tFile
>        export snapshot from rect pRect to file tFile as JPEG

> But if (as below) I add the window parameter to use window-relative 
> coords, it doesn't work.  Instead, I get the error:  "export: no image 
> selected, or image not open".  It's as if it is suddenly ignoring the 
> "snapshot" form of export.
>
>        put the ticks & "temp.jpg" into tFile
>        put the rect of graphic "PFrame" into pRect
>        put the id of this wd into WinId
>        put prect && winId && defaultfolder && tFile
>        export snapshot from rect pRect of window WinId to file tFile 
> as JPEG
>
> BTW, in my case, the message box returns:
> 240,480,960,960 1076 /Volumes/Starfish Internal 250/Scripter/lessons 
> 66803362548temp.jpg
> so the variables are evaluating ok I think.
> Help!!!
> Tearing my hair out (what's left of it) with this one.
>
> Chris

Regards

Klaus Major
klaus at major-k.de
http://www.major-k.de



More information about the use-livecode mailing list