[vtkusers] How to get the framebuffer

Mathieu Westphal mathieu.westphal at kitware.com
Wed Jul 25 03:52:07 EDT 2018


Hi LingHai

Make sure you have rendered into the renderWindow first.
(renderWindow->Render())
And try to read from the front and the back buffer.

Best regards,

Mathieu Westphal

On Tue, Jul 24, 2018 at 7:57 PM, ling Hai <qyaoza at gmail.com> wrote:

> Hi,
> I am new to vtk and I am trying to get the front framebuffer from the
> renderwindow like this:
> int * dim = renderWindow->GetSize();
> unsigned char* pixels = renderWindow->GetPixelData(0,
> 0,dim[0]-1,dim[1]-1,true);
>
> but in pixels there is only a null value. I am using this on a 3d render
> if that makes a difference the above segment of code called after rendering
> the volume. What am I missing? Any help is appreciated thanks.
> Linghai
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> https://public.kitware.com/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180725/60df0f5a/attachment.html>


More information about the vtkusers mailing list