<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>I'm using QPixmap::grabWidget() but the vtk scene appears empty.</span></div><div><br><span></span></div><div><span>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.</span></div><div><span>Nevertheless, on my computer, the screenshots are working when using a vtk version compiled with offscreen option set to on.</span></div><div><br></div><div>Is the difference of behavior between the two computer something normal ?</div><div>What can I do to make the grabWidget working without compiling vtk with the offscreen option.</div><div><br></div><div>Anyway, thank you for your
help.<br><span></span></div><div><span><br></span></div><div><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><font face="Arial" size="2"><hr size="1"><b><span style="font-weight:bold;">De :</span></b> Julien Finet <julien.finet@kitware.com><br><b><span style="font-weight: bold;">À :</span></b> Clinton Stimpson <clinton@elemtech.com><br><b><span style="font-weight: bold;">Cc :</span></b> vtkusers@vtk.org; Malsoaz James <jmalsoaz@yahoo.fr><br><b><span style="font-weight: bold;">Envoyé le :</span></b> Mardi 20 Septembre 2011 7h30<br><b><span style="font-weight: bold;">Objet :</span></b> Re: [vtkusers] Re : Enable/Disable Offscreen rendering<br></font><br><div id="yiv1202131328">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 rel="nofollow" target="_blank" href="http://www.commontk.org/index.php/Main_Page">CTK</a>, we handle that problem:</div><div> - ctk::grabWidget for QGLWidgets: <a rel="nofollow" target="_blank" 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 rel="nofollow" target="_blank" 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="yiv1202131328gmail_quote">On Mon, Sep 19, 2011 at 10:40 AM, Clinton Stimpson <span dir="ltr"><<a rel="nofollow" ymailto="mailto:clinton@elemtech.com" target="_blank" href="mailto:clinton@elemtech.com">clinton@elemtech.com</a>></span> wrote:<br>
<blockquote class="yiv1202131328gmail_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="yiv1202131328h5"><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 rel="nofollow" ymailto="mailto:madapeti@gmail.com" target="_blank" href="mailto:madapeti@gmail.com">madapeti@gmail.com</a>><br>
> À : <a rel="nofollow" ymailto="mailto:vtkusers@vtk.org" target="_blank" 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 rel="nofollow" target="_blank" href="http://vtk.1045678.n5.nabble.com/Enable-Disable-Offscreen-rendering-tp4818">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 rel="nofollow" target="_blank" href="http://www.kitware.com">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a rel="nofollow" target="_blank" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a rel="nofollow" target="_blank" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a rel="nofollow" target="_blank" href="http://www.vtk.org/mailman/listinfo/vtkusers">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 rel="nofollow" target="_blank" href="http://www.csimsoft.com">www.csimsoft.com</a><br>
</font><div><div></div><div class="yiv1202131328h5">_______________________________________________<br>
Powered by <a rel="nofollow" target="_blank" href="http://www.kitware.com">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a rel="nofollow" target="_blank" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a rel="nofollow" target="_blank" href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a rel="nofollow" target="_blank" href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div></div>
</div><br><br></div></div></div></body></html>