[vtkusers] saving vtk render as jpg file?

Glen Lehmann glehmann at imaging.robarts.ca
Fri Mar 28 13:22:01 EST 2003


Hi Sebastien,

You have to use vtkWindowToImageFilter along with the vtkPPMWriter now.  
Just have a look at the examples on the man page for the 
vtkWindowToImageFilter.

Hope it helps,
Glen

Sebastian Geiger wrote:

> Hello,
>
> I've recently moved my work from Windows to Linux.  On Windows I was 
> using the (very old) vtk3.2 dll libraries and tcl scripts for 
> visualization. On the linux box I have sucessfully compiled the latest 
> VTK version and run Tcl/Tk 8.4. My tcl scripts work fine with one 
> exception: At the end of the script I am always using
>
> renWin SetSize 1000 1000
>
> iren Initialize
> iren SetUserMethod {wm deiconify .vtkInteract}
>
> renWin SetFileName "picture.ppm"
> renWin SaveImageAsPPM
>
> wm withdraw .
>
> To get a *.ppm file of the visualization (which I then transformed 
> into a JPG file). The new VTK version no complains that the methods 
> SetFileName and SaveImageAsPPM cannot be found or a re called with 
> incorrect parameters.
>
> Does anyone know what to do to save the renderer as a PPM or better 
> JPG or TIFF file with VTK 4.2 and Tcl 8.4 and how the little code must 
> be changed?
>
> Thanks for the help!
>
> Sebastian
>





More information about the vtkusers mailing list