[vtkusers] Transparency in screenshot

Dženan Zukić dzenanz at gmail.com
Mon Jan 31 10:53:03 EST 2011


Hi all,

I have a problem with saving transparency from a screenshot into a file.

unsigned char
*pixDebug=vis->GetRenderWindow()->GetRGBACharPixelData(0,0,512,512,1);
//pixDebug contains alpha channel (determined by manual inspection of array
in debugger)

vtkWindowToImageFilter *windowGrabber=vtkWindowToImageFilter::New();
windowGrabber->SetInput(vis->GetRenderWindow()); //vis is a QVTK component

vtkPNGWriter *writer=vtkPNGWriter::New();
writer->SetInput(windowGrabber->GetOutput());
writer->SetFileName(filename.c_str());
writer->Write(); //file does not have alpha channel

Do you have any suggestions?

Thanks,
Dženan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110131/f2a0a25e/attachment.htm>


More information about the vtkusers mailing list