taking a picture of the card programmatically

Klaus Major klaus at major-k.de
Thu Oct 21 07:45:59 EDT 2004


Hi Eric,

> I want to programmatically take a screenshot of the card.
>
> "copy image 1 of this card" won't work for several reasons
> 1) that would not include a picture of the buttons or fields.
> 2) that would not include images 2 through n of this card.
> And I have to do it programmatically, preferably cross platform so no
> applescript.
>
> Any ideas?

Sure :-)

...
   import snapshot from rect (the rect of this stack)
...

Et voila (or "Et Viola" as some listees, mostly MEN, prefer ;-) an 
image of your
current card with ALL object on it...

You can also export a snapshot to a file in different formats with one 
line,
if you need to:

...
  export snapshot from rect (the rect of this stack) to file 
"sdssds.jpg" as JPEG
### or "...as PNG"
...

See the dox for "snapshot"...


Hope this helps...


Regards

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



More information about the use-livecode mailing list