[vtkusers] Offscreen rendering (win32)

Dov Mayzlish dov.mayzlish at philips.com
Mon Jun 11 11:04:34 EDT 2007


Hi,


In win32 OS, vtk version 5.0.3 I'm trying to create an offscreen rendered 
image, and get a black image (when onscreen the actor appears perfect).

My code is similar to this:

vtkRenderer *ren1 = vtkRenderer::New();
ren1->AddActor(actor);
vtkRenderWindow *renWin = vtkRenderWindow::New();
renWin->OffScreenRenderingOn();
renWin->AddRenderer(ren1);
renWin->Render();

vtkWindowToImageFilter *w2if = vtkWindowToImageFilter::New();
w2if->SetInput( renWin);

vtkJPEGWriter *writeJPEG = vtkJPEGWriter::New();
writeJPEG->SetInput (w2if->GetOutput() );
writeJPEG->SetQuality(100);
writeJPEG->SetFileName("out.jpg");
writeJPEG->ProgressiveOff();
writeJPEG->Write();

Can anyone help with ideas?

Thanks,
Dov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070611/5d0899f4/attachment.htm>


More information about the vtkusers mailing list