Creating an auto-updating button icon thumbnail image from card snapshot

Richard Gaskin ambassador at fourthworld.com
Fri Apr 1 14:05:01 EDT 2011


Jacque wrote:
> While you can take snapshots of objects that aren't open, you can't take
> them of cards that aren't open. Cards are not objects. I was unable to
> get a snapshot of another card unless I went there first.

I didn't know I couldn't do that so I tried it a long time ago and it 
seemed to work so I've been using it since. :)

In fact, after reading your post I wondered if it was dependent on 
having rendered the card during the current session, so I wrote this to 
test it on a stack I haven't opened in weeks:

on mouseUp
   answer file "Select a stack file:"
   if it is empty then exit to top
   put it into tStackfile
   export snapshot from cd 1 of stack tStackFile to \
     file (specialfolderPath("desktop")&"/myimage.png") as png
end mouseUp

Worked a treat.

--
  Richard Gaskin
  Fourth World
  LiveCode training and consulting: http://www.fourthworld.com
  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
  LiveCode Journal blog: http://LiveCodejournal.com/blog.irv




More information about the use-livecode mailing list