[vtkusers] Re : Re : Enable/Disable Offscreen rendering

Malsoaz James jmalsoaz at yahoo.fr
Tue Sep 20 05:18:55 EDT 2011


I'm using QPixmap::grabWidget() but the vtk scene appears empty.

I tested the same thing with another computer and it worked (whatever the offscreen option is). The difference between the two computers is the graphic card. Mine has no graphic card (only intel chipset), the other one has a graphic card.
Nevertheless, on my computer, the screenshots are working when using a vtk version compiled with offscreen option set to on.

Is the difference of behavior between the two computer something normal ?
What can I do to make the grabWidget working without compiling vtk with the offscreen option.

Anyway, thank you for your help.




________________________________
De : Julien Finet <julien.finet at kitware.com>
À : Clinton Stimpson <clinton at elemtech.com>
Cc : vtkusers at vtk.org; Malsoaz James <jmalsoaz at yahoo.fr>
Envoyé le : Mardi 20 Septembre 2011 7h30
Objet : Re: [vtkusers] Re : Enable/Disable Offscreen rendering


Hi,

QPixmap::grabWidget() can fail with QGLWidgets or QVTKWidgets, especially if there is another window in front of the widgets (on Ubuntu with "No Effects") .


However QGLWidget::grabFrameBuffer() / QVTKWidgets::cachedImage work fine.

In CTK, we handle that problem:
 - ctk::grabWidget for QGLWidgets: https://github.com/commontk/CTK/blob/master/Libs/Widgets/ctkWidgetsUtils.cpp
 - ctk::grabVTKWidget for QVTKWidgets: https://github.com/commontk/CTK/blob/master/Libs/Visualization/VTK/Widgets/ctkVTKWidgetsUtils.cpp

Hth,
Julien.


On Mon, Sep 19, 2011 at 10:40 AM, Clinton Stimpson <clinton at elemtech.com> wrote:


>To take a snapshot of the app, QPixmap::grabWidget() is supposed to work.
>Have you tried that?
>QVTKWidget will take the onscreen pixels and put it in that QPixmap, while the
>other QWidgets will paint themselves into the QPixmap.
>If you want to use offscreen, I suppose you could set the offscreen flag, then
>still call QPixmap::grabWidget().
>
>Clint
>
>
>On Monday, September 19, 2011 05:56:17 am Malsoaz James wrote:
>> I would like to take screenshots of the entire Qt window containing the vtk
>> scene. The solution with vtkWindowToImageFilter can only be used to take
>> screenshots of the vtk scene not for my entire user interface.
>>
>> Thus, the screenshot process is made using Qt.
>>
>>
>> ________________________________
>> De : peterm <madapeti at gmail.com>
>> À : vtkusers at vtk.org
>> Envoyé le : Lundi 19 Septembre 2011 12h13
>> Objet : Re: [vtkusers] Enable/Disable Offscreen rendering
>>
>> Dear James,
>>
>> vtkWindowToImageFilter can save the content of the selected render window.
>> Actually how else did you manage to save the window content if not using
>> it?
>>
>> Peter
>>
>> --
>> View this message in context:
>> http://vtk.1045678.n5.nabble.com/Enable-Disable-Offscreen-rendering-tp4818
>> 233p4818424.html Sent from the VTK - Users mailing list archive at
>> Nabble.com.
>> _______________________________________________
>> 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
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>
>--
>Clinton Stimpson
>Elemental Technologies, Inc
>Computational Simulation Software, LLC
>www.csimsoft.com
>
>_______________________________________________
>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
>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110920/f2ca9d70/attachment.htm>


More information about the vtkusers mailing list