export jpeg frustration

Eric Chatonet eric.chatonet at sosmartsoftware.com
Wed Apr 13 07:27:06 EDT 2005


Hi Chris,

I think that Klaus formulation is better ;-)
But using a function is a good choice:

function GlobalObjRect pObj
   return globalLoc(the topLeft of pObj),globalLoc(the botRight of pObj)
end GlobalObjRect

put GlobalObjRect(the long ID of graphic "PFrame") into tRect -- Æ
export snapshot from rect tRect to file tFile as JPEG

Le 13 avr. 05, ˆ 13:16, Chris Carroll-Davis a Žcrit :

> Eric -
>
> Thanks so much!  I'm pleased I wasn't doing something daft.  Your 
> function does the trick beautifully.
>
> Regards,
>
> Chris
>
>
> On 13 Apr 2005, at 12:10, Eric Chatonet wrote:
>
>> Hi Chris,
>>
>> The export snapshot from rect of window windowID to file... does not 
>> appear very reliable.
>> So convert the rect of your object to global coordinates and use 
>> export snapshot from rect to file... instead :-)
>>
>> function GlobalObjRect pRect
>>   return item 1 of pRect + the left of this stack,item 2 of pRect + 
>> the top of this stack,item 3 of pRect + the left of this stack,item 4 
>> of pRect + the top of this stack
>> end GlobalObjRect
>>
>> Best regards,
>>
>> Le 13 avr. 05, ˆ 13:01, Chris Carroll-Davis a Žcrit :
>>
>>> 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


Eric Chatonet.
----------------------------------------------------------------
So Smart Software

For institutions, companies and associations
Built-to-order applications: management, multimedia, internet, etc.
Windows, Mac OS and Linux... With the French touch
----------------------------------------------------------------
Web site		http://www.sosmartsoftware.com/
Email		eric.chatonet at sosmartsoftware.com/
Phone		33 (0)1 43 31 77 62
Mobile		33 (0)6 20 74 50 86
----------------------------------------------------------------


More information about the use-livecode mailing list