When Export Snapshot doesn't work

Richard Gaskin ambassador at fourthworld.com
Wed Apr 13 22:22:43 EDT 2011


Graham Samuel wrote:

 > I'm using 'export snapshot' and finding stuff that doesn't seem to
 > be in the docs, nor did an archive search turn up anything. However
 > I can never rule out finger trouble on my part.
 >
 > Can anyone confirm the following:
 >
 > 1. You can't export a snapshot from a card in a substack which
 > isn't open - you have to 'go to' the stack first to activate it.
 > The thing you're snapshotting can be off the screen, though (with
 > a loc like 10000,10000).

I think the rest of what you wrote is true, but as of v2.7 and later you 
can now export snapshots of any object, whether in an open stack or not.

The key is to use an object reference rather than specifying a rect. 
With a rect it just grabs the specified portion of the screen buffer, 
but when specifying an object it triggers LC's internal routines to 
render the object into an internal buffer which then becomes the 
exported image data.

The syntax I just verified this with is:

   export snapshot from cd 3 of stack "SomeUnopenedStack" \
      to file "dsfdfgd.png" as png

AFAIK the only thing that doesn't render properly when exporting an 
unopened card is the text in backround fields which have their 
sharedText set to false; those are set up from the internal record when 
a stack is opened, separate from the routine that images them, so such 
screen shots will likely show only the text from the first card (at 
least that's what I see here).

But it looks like everything else renders well, very handy for 
thumbnailing cards and stuff like that.

--
  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