[vtkusers] vtkJPEGWriter interactor problem

Brenton.Thomas at HardYards.info Brenton.Thomas at HardYards.info
Mon Feb 3 02:01:06 EST 2003


A couple of months work later and I have this nice program to visualize
electromagnetic fields. Put in the final function to save an image to a
JPEG.  And you guessed it a problem.

It seems that when you have saved an image to file the interactor gets all
screwed up so that mouse events no longer are sent to the display.  Could
the window to image filter or something be redirecting the interactor ?

I know the problem is somewhere in this function - but I can't see where?
Can anyone help - or do I need to perform some off screen rendering
(somehow) save the image there and then redirect everything back to the
screen?


void CvtkInfrastructure::Snapshot(CString cFName)
{
 vtkWindowToImageFilter *vtkImageFilter;
 vtkJPEGWriter *vtkJpegWriter;

 vtkImageFilter=vtkWindowToImageFilter::New();
 vtkJpegWriter=vtkJPEGWriter::New();

 vtkImageFilter->SetInput(m_pRenWin);
 vtkJpegWriter->SetInput(vtkImageFilter->GetOutput());

 vtkJpegWriter->SetFileName(cFName);
 vtkJpegWriter->SetQuality(100);
 vtkJpegWriter->ProgressiveOff();
 vtkJpegWriter->Write();

 vtkImageFilter->Delete();
 vtkJpegWriter->Delete();

}

Brenton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030203/e3db9f85/attachment.htm>


More information about the vtkusers mailing list