[vtkusers] Re : Enable/Disable Offscreen rendering

Julien Finet julien.finet at kitware.com
Tue Sep 20 01:30:58 EDT 2011


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 <http://www.commontk.org/index.php/Main_Page>, 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/e5c19278/attachment.htm>


More information about the vtkusers mailing list