[Insight-users] RE: [vtkusers] problem with vtkWin32OpenGLRenderWindow

Renaud Isabelle renauisa at yahoo.fr
Thu Jun 9 16:36:57 EDT 2005


Don't anyone have a solution? I really don't manage to solve this. 
 
Why just this 2 lines added could change something?
 
Please
Isa

Renaud Isabelle <renauisa at yahoo.fr> a écrit :
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 ! _______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers

		
---------------------------------
 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://public.kitware.com/pipermail/insight-users/attachments/20050609/392c6131/attachment.htm


More information about the Insight-users mailing list