[vtkusers] vtkWindowToImageFilter - black image

Fredrik frejon at gmail.com
Tue Jun 9 11:02:31 EDT 2015


Hello. There are several threads on this topic, and the few I see, the
proposed solutions are not enough or the thread is left unresolved. see
this:

http://public.kitware.com/pipermail/vtkusers/2014-October/085358.html
http://public.kitware.com/pipermail/vtkusers/2014-October/085294.html

I still am unable to generate anything else than a black image.
I'm on the latest VTK, under Mac OS X 10.10.  I also tried offscreen
rendering, but no luck.

Hours of googling and testing solutions have proven unsuccessful, I'd
really appreciate if anyone could help me.

here's a snippet of my code if you think it'll help

        tempFile = "xyz.bmp";
        // write to temporary bmp file
        vtkBMPWriter writer = new vtkBMPWriter();
        vtkWindowToImageFilter windowToImageFilter = new
vtkWindowToImageFilter();
        windowToImageFilter.ReadFrontBufferOff();
        windowToImageFilter.SetMagnification(1);
        windowToImageFilter.SetInput(renderWindow);
        windowToImageFilter.SetInputBufferTypeToRGBA();
        windowToImageFilter.ReadFrontBufferOff();

        windowToImageFilter.Update();

        windowToImageFilter.ReadFrontBufferOff();
        writer.SetInputConnection(windowToImageFilter.GetOutputPort());
        writer.SetFileName(tempFile);
        writer.Write();



Kind Regards, Fredrik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150609/c0a4520d/attachment.html>


More information about the vtkusers mailing list