[vtkusers] For help: vtk application can not capreture screenshot or crashes in 3D under Windows Vista.

Richard An richardander at yahoo.com
Tue Nov 20 00:15:49 EST 2007


Hello everyone:

I developed an windows application in Visual Studio with VTK-4.4. This programs runs very well under windows XP.. 

I also installed this program under Windows Vista. Unforunately, I got the following very headache problems and have no idea how to solve them: 

- I used vtkJPEGwriter to capture the screenshot in vtk window. It works in Windows XP. however, in Windows Vista, the image captured is blank. Following is hte code:

...
    // Create the correct type of image writer, based on the file type ( jpg)
    vtkImageWriter* writer = 0x0;
    writer = vtkJPEGWriter::New();

    // Grab the render window and create an image filter
    vtkRenderWindow* renderWindow = m_VtkWidget->GetRenderWindow();
    vtkWindowToImageFilter* toImageFilter = vtkWindowToImageFilter::New();

    // Do the work
    toImageFilter->SetInput( renderWindow );
    writer->SetInput( toImageFilter->GetOutput() );
    writer->SetFileName( filename ); 
    writer->Write();

    // Clean up VTK objects
    toImageFilter->Delete();
    writer->Delete();


2. The second problem is:  a 3D object was rendered in vtk window. After manipulating the rendered 3D object ( shift, zooming, rotating ...) in VTK window for a while, the application crashes and quits without any warning message. 


Does anyone have any good idea about this? shall I compile the vtk in windows Vista? or I should  change the code ? or other solutions? 

It would be greatly applicated if you could let me know how to fix it or share your experience iwth me!

Thank you very much!

Richard - 

       
---------------------------------
Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20071119/9bd23736/attachment.htm>


More information about the vtkusers mailing list