Hi,<div><br></div><div>QPixmap::grabWidget() can fail with QGLWidgets or QVTKWidgets, especially if there is another window in front of the widgets (on Ubuntu with "No Effects") .</div><div><div><br></div><div>However QGLWidget::grabFrameBuffer() / QVTKWidgets::cachedImage work fine.</div>
<div><br></div><div>In <a href="http://www.commontk.org/index.php/Main_Page">CTK</a>, we handle that problem:</div><div> - ctk::grabWidget for QGLWidgets: <a href="https://github.com/commontk/CTK/blob/master/Libs/Widgets/ctkWidgetsUtils.cpp">https://github.com/commontk/CTK/blob/master/Libs/Widgets/ctkWidgetsUtils.cpp</a></div>
<div> - ctk::grabVTKWidget for QVTKWidgets: <a href="https://github.com/commontk/CTK/blob/master/Libs/Visualization/VTK/Widgets/ctkVTKWidgetsUtils.cpp">https://github.com/commontk/CTK/blob/master/Libs/Visualization/VTK/Widgets/ctkVTKWidgetsUtils.cpp</a></div>
<div><br></div><div>Hth,</div><div>Julien.</div><div><br><div class="gmail_quote">On Mon, Sep 19, 2011 at 10:40 AM, Clinton Stimpson <span dir="ltr"><<a href="mailto:clinton@elemtech.com">clinton@elemtech.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
To take a snapshot of the app, QPixmap::grabWidget() is supposed to work.<br>
Have you tried that?<br>
QVTKWidget will take the onscreen pixels and put it in that QPixmap, while the<br>
other QWidgets will paint themselves into the QPixmap.<br>
If you want to use offscreen, I suppose you could set the offscreen flag, then<br>
still call QPixmap::grabWidget().<br>
<br>
Clint<br>
<div><div></div><div class="h5"><br>
On Monday, September 19, 2011 05:56:17 am Malsoaz James wrote:<br>
> I would like to take screenshots of the entire Qt window containing the vtk<br>
> scene. The solution with vtkWindowToImageFilter can only be used to take<br>
> screenshots of the vtk scene not for my entire user interface.<br>
><br>
> Thus, the screenshot process is made using Qt.<br>
><br>
><br>
> ________________________________<br>
> De : peterm <<a href="mailto:madapeti@gmail.com">madapeti@gmail.com</a>><br>
> À : <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
> Envoyé le : Lundi 19 Septembre 2011 12h13<br>
> Objet : Re: [vtkusers] Enable/Disable Offscreen rendering<br>
><br>
> Dear James,<br>
><br>
> vtkWindowToImageFilter can save the content of the selected render window.<br>
> Actually how else did you manage to save the window content if not using<br>
> it?<br>
><br>
> Peter<br>
><br>
> --<br>
> View this message in context:<br>
> <a href="http://vtk.1045678.n5.nabble.com/Enable-Disable-Offscreen-rendering-tp4818" target="_blank">http://vtk.1045678.n5.nabble.com/Enable-Disable-Offscreen-rendering-tp4818</a><br>
> 233p4818424.html Sent from the VTK - Users mailing list archive at<br>
> Nabble.com.<br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br>
</div></div><font color="#888888">--<br>
Clinton Stimpson<br>
Elemental Technologies, Inc<br>
Computational Simulation Software, LLC<br>
<a href="http://www.csimsoft.com" target="_blank">www.csimsoft.com</a><br>
</font><div><div></div><div class="h5">_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div></div>