[vtkusers] Re : Enable/Disable Offscreen rendering

Clinton Stimpson clinton at elemtech.com
Tue Sep 20 10:17:46 EDT 2011


On Monday, September 19, 2011 11:30:58 pm Julien Finet wrote:
> 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.cp
> p - ctk::grabVTKWidget for QVTKWidgets:
> https://github.com/commontk/CTK/blob/master/Libs/Visualization/VTK/Widgets/
> ctkVTKWidgetsUtils.cpp

Do you know why this method works for you and not the code that is already in 
QVTKWidget::paintEvent() ?  It appears to work off the back buffer instead of 
the front buffer.  I thought even the back buffer on some machines had garbage 
with other windows in front.

Clint

> 
> 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-tp481
> > 8
> > 
> > > 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

-- 
Clinton Stimpson
Elemental Technologies, Inc
Computational Simulation Software, LLC
www.csimsoft.com



More information about the vtkusers mailing list