From: Kadir H. <kha...@ya...> - 2008-01-14 12:09:25
|
Lorenzo Isella wrote: > I managed to get some decent animations on my laptop (running Debian > testing); now my question is how to get at least a set of png (or any > other decent format; pdf, eps, jpg etc...) files with the "snapshots" > of my system. I can answer your question for Windows environment. Same or similar solution MAY or MAY NOT apply for Linux, I have no experience in Linux environment. First you need to install Python Image Library, PIL, if you have not done so already. You may be using it already, if you are using TEXTURE feature of the recent Beta versions of VPython. Then in your source code you need to add some lines, like the followings: import Image import ImageGrab ... Your animation code goes here ... while looping: im = ImageGrab.grab((24,30,ImageWidth-4,ImageHeight-4)) fn = "Cat"+str(pn)+".png" im.save(fn) fn is the filename in Windows environment. IF THIS SYSTEM WORKS in LINUX, then someting similar to that of filename should be sufficient. ImageGrab needs the display location (upper-left corner) and display sizedefined to it, so it picks up the image from the screen for you. You need to set up some sort of a counter in the loop like the str(pn), to get a unique file name for each snapshot. Hope it works... Kadir ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs |