[vtkusers] Save resuult of a volume rendered as a JPEG image

kent williams nkwmailinglists at gmail.com
Thu Jun 11 14:08:39 EDT 2009


All you need to do is to get a pointer to the render window, and do
something like this:

void
WindowToJPG(vtkRenderWindow *rw, const char *filename)
{
  vtkWindowToImageFilter *filter = vtkWindowToImageFilter::New();
  filter->SetInput(rw);
  vtkJPEGWriter *jw = vtkJPEGWriter::New();
  jw->SetInput(filter->GetOutput());
  jw->SetFileName(filename);
  jw->Write();
  jw->Delete();
  filter->Delete();
}


On Wed, Jun 10, 2009 at 3:55 AM, <wassim_belhadj at topnet.tn> wrote:
> Hi
> I'm working on Volume Rendering.
> I want to know how to get the output of a volume rendered and save the
> resuult as a JPEG image.
> Best Regards,
> Wassim
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



More information about the vtkusers mailing list