swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swarm-Support] saving swarm images


From: Steve Railsback
Subject: Re: [Swarm-Support] saving swarm images
Date: Mon, 18 Oct 2004 09:51:18 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)

Mark Alexiuk wrote:
Hi,

Could someone remind me how to save a series of images or screenshots
from a swarm simulation?
I am using the Fedora Core version.

Thanks a lot,
Mark Alexiuk


Here is an example method that writes the raster object "worldRaster" to a .png file each time it is called ... it is called once per time step, and the file name includes the time step number (currentTime).

If you skip the "setWidget" command, it grabs the whole screen.

I use some shareware called GIF Construction Set to assemble the .png files into a movie. I'm sure there are other ways.

Steve R.

-(void) writeFrame {
  char filename[256];
  id pixID;

sprintf(filename, "Model%03d_Frame%03ld.png", modelNumber, getCurrentTime());

 pixID =  [Pixmap createBegin: [self getZone]];
 [pixID  setWidget: worldRaster];
 pixID = [pixID createEnd];
 [pixID save: filename];
 [pixID drop];

}



--
Lang Railsback & Associates
250 California Ave.
Arcata CA 95521
707 822 0453



reply via email to

[Prev in Thread] Current Thread [Next in Thread]