[vtkusers] problem with vtkWin32OpenGLRenderWindow

Renaud Isabelle renauisa at yahoo.fr
Thu Jun 9 11:47:03 EDT 2005


Hi,
 
I read your code example and I think this could help me because this seems to be right.
 
- When I display directly on screen, the image "essai.bmp" saved is the exact copy of what is rendered on screen: here is my code where everything is fine: 
 
// render to memory with m_pRenderWindow as a vtkWin32OpenGLRenderWindow.
m_pRenderWindow->Render();

vtkWindowToImageFilter* renSrc = vtkWindowToImageFilter::New();
renSrc->SetInput(m_pRenderer);
vtkBMPWriter* writer = vtkBMPWriter::New();
writer->SetInput(renSrc->GetOutput());
writer->SetFileName("essai.bmp");
writer->Write();

 
- However, to avoid flickering on screen, I want to render off screen by double buffering. Here is the new code. Just is added the line 

// render to memory with m_pRenderWindow as a vtkWin32OpenGLRenderWindow.
int *size = m_pRenderWindow->GetSize();
m_pRenderWindow->SetupMemoryRendering(size[0], size[1], GetDC() ->GetSafeHdc());
m_pRenderWindow->Render();

vtkWindowToImageFilter* renSrc = vtkWindowToImageFilter::New();
renSrc->SetInput(m_pRenderer);
vtkBMPWriter* writer = vtkBMPWriter::New();
writer->SetInput(renSrc->GetOutput());
writer->SetFileName("essai.bmp");
writer->Write();

m_pRenderWindow->ResumeScreenRendering();
 
Problem: The image saved in essai.bmp is white. How could this be? I really don't understand.I check class vtkWin32OpenGLRenderWindow and I am stuck on this problem for 3 days. 
 
Please help
Isa



		
---------------------------------
 Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
 Téléchargez le ici !  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050609/aae3935d/attachment.htm>


More information about the vtkusers mailing list