Export Snapshot PNG Workaround

Dave dave at looktowindward.com
Wed Mar 21 11:11:14 EDT 2007


Hi All,

Thought I'd share the workaround.

With a lot of help from Jacque I have managed to figure out a work  
around. There were actually three separate problems and acted  
together to make it hard to figure out what the problem is.

Problem 1.

The following statement will cause an error after an unknown number  
of files have been written.

     export snapshot from group "GroupCounter" to file myFileName as PNG

The work around is to use this form instead:

      put the windowID of this stack into myWindowID
      put the rect of "myGroup" into myRect
      export snapshot from rect myRect of window myWindowID to file  
myFileName as PNG

This stops the error occurring and allows you to move on to the next  
problem.

Problem 2.

Using the export snapshot command under the IDE results in memory  
being leaked on each image exported.

The work around is to Compile the App into a Standalone and test  
using a smaller number of files.


Problem 3.

RunRev does not garbage collect until after a handler returns.

The work around is to have two handers and use the timed send command  
process a smaller number of images at time.

Once you put all three of these together, you can write lots of images.

Thanks a lot to everyone that helped on this.
All the Best
Dave




More information about the use-livecode mailing list