Printing and previewing

Klaus Major klaus at major-k.de
Thu Mar 15 10:23:55 EDT 2007


Hi Martin,

> Hi Klaus,
> thanks for your interest. The following are the pertinent lines. If I
> set the left of stack "Printstack" to say 250, it is onscreen and the
> capture works OK (but this requires the printstack to be visible and
> hence is not presenting a polished result for a print preview). If I
> set to 2500 I get the previously mentioned error. If I set to part on
> screen, part off I get only the on-screen portion. (I think this
> behaviour has been discussed on the list before)
>
> set the left of stack "printstack" to 2500  --off screen
> put the windowid of stack "PrintStack" into tWinID
> put "0,0,"& the width of stack "printstack" & comma & the height of
> stack "printstack" into trect
> set the rect of the templateimage to trect
> create invisible image imgname in group "Pages" of stack  
> "PrintPreview"
> export snapshot from rect trect of window tWinID to pictvar as JPEG
> put pictvar into image imgname of stack "PrintPreview"
>
>
>> sounds like a syntax problem. Could you post your code?
>>
>> >> ... You might be able to try export image and see if it doesn't
>> >> work with offscreen images in 2.7...I seem to think that might  
>> work.

i created 2 teststacks, modified your script a little bit for these  
stacks and ended
with a nice, correct yet invisible screenshot of the "printstack"s  
content!

on mouseUp
   put the loc of stack "printstack" into altloc
   set the left of stack "printstack" to 2500  --off screen
   put the windowid of stack "PrintStack" into tWinID
   put "0,0,"& the width of stack "printstack" & comma & the height  
of stack "printstack" into trect
   set the rect of the templateimage to trect
   create invisible image imgname
   export snapshot from rect trect of window tWinID to pictvar as JPEG
   put pictvar into image imgname of this stack
   SHOW img imgname of this stack
   ## optional, but looks better ;-)
   set the loc of stack "printstack" to altloc
end mouseUp

Did I miss something?


Regards

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




More information about the use-livecode mailing list