<div dir="ltr"><div>I like to just save a screenshot for that purpose.  Following is some sample code (I did not run this exactly, so you may need to tweak it, add includes, etc...)</div><div><br></div><div><b>Python</b></div><div><span style="font-family:monospace,monospace"><br></span></div><div><span style="font-family:monospace,monospace">from vtk import *</span><br></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">source = vtkConeSource()</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">mapper = vtkPolyDataMapper()</font><span style="font-family:monospace,monospace">mapper.SetInputConnection(source.GetOutputPort())</span></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">actor = vtkActor()</font></div><div><font face="monospace, monospace">actor.SetMapper(mapper)</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">ren = vtkRenderer()</font></div><div><font face="monospace, monospace">renWin = vtkRenderWindow()</font></div><div><font face="monospace, monospace">renWin.AddRenderer(ren)</font></div><div><font face="monospace, monospace">ren.AddActor(actor)</font></div><div><font face="monospace, monospace">renWin.Render()</font></div><div><span style="font-family:monospace,monospace"><br></span></div><div><span style="font-family:monospace,monospace">w2if = vtkWindowToImageFilter()</span><br></div><div><font face="monospace, monospace">w2if.SetInput(renWin)</font></div><div><font face="monospace, monospace">w2if.ReadFrontBufferOff()</font></div><div><font face="monospace, monospace">writer = vtkPNGWriter()</font></div><div><font face="monospace, monospace">writer.SetInputConnection(w2if.GetOutputPort())</font></div><div><font face="monospace, monospace">w2if.Update()</font></div><div><font face="monospace, monospace">writer.SetFileName('/tmp/savedConeImage.png')</font></div><div><font face="monospace, monospace">writer.Write()</font></div><div><br></div><div><b>C++</b></div><div><br></div><div><div><font face="monospace, monospace">vtkSmartPointer<vtkConeSource> source = vtkSmartPointer<vtkConeSource>::New();<br><br></font></div><div><font face="monospace, monospace">vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();<br>mapper->SetInputConnection(source->GetOutputPort());<br><br>vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();<br>actor->SetMapper(mapper);<br><br>vtkSmartPointer<vtkRenderer> ren = vtkSmartPointer<vtkRenderer>::New();<br>vtkSmartPointer<vtkRenderWindow> renWin = vtkSmartPointer<vtkRenderWindow>::New();<br>renWin->AddRenderer(ren);<br>ren->AddActor(actor);<br>renWin->Render();<br><br>vtkSmartPointer<vtkWindowToImageFilter> w2if = vtkSmartPointer<vtkWindowToImageFilter>::New();<br>w2if->SetInput(renWin);<br>w2if->ReadFrontBufferOff();<br><br></font></div><div><font face="monospace, monospace">vtkSmartPointer<vtkPNGWriter> writer = vtkSmartPointer<vtkPNGWriter>::New();<br>writer->SetInputConnection(w2if->GetOutputPort());<br>w2if->Update();<br><br>writer->SetFileName("/tmp/savedConeImage.png");<br>writer->Write();</font></div></div><div><br></div><div><br></div><div>Hope that helps.</div><div><br></div><div>Cheers,</div><div>Scott</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 13, 2017 at 3:01 PM, Elhassan Abdou <span dir="ltr"><<a href="mailto:elhassan.abdou@gmail.com" target="_blank">elhassan.abdou@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="#954F72"><div class="m_3758894933595875807WordSection1"><p class="MsoNormal">Hi</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Can you suggest a way to debug my output from the offscreen rendering process ?</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I appreciate your help</p><p class="MsoNormal">Elhassan</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986" target="_blank">Mail</a> for Windows 10</p><p class="MsoNormal"><u></u> <u></u></p><div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal" style="border:none;padding:0in"><b>From: </b><a href="mailto:utkarsh.ayachit@kitware.com" target="_blank">Utkarsh Ayachit</a><br><b>Sent: </b>Wednesday, December 13, 2017 3:58 PM<br><b>To: </b><a href="mailto:elhassan.abdou@gmail.com" target="_blank">Elhassan Abdou</a><br><b>Cc: </b><a href="mailto:vtkusers@vtk.org" target="_blank">vtk</a><br><b>Subject: </b>Re: [vtkusers] EGL offscreen rendering</p></div><span class=""><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Elhassan,</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">For VTK 8.1, you can set the following CMake variables:</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">VTK_USE_X=OFF</p><p class="MsoNormal">VTK_OPENGL_HAS_EGL=ON</p><p class="MsoNormal">EGL_INCLUDE_DIR: Path to directory containing GL/egl.h.</p><p class="MsoNormal">EGL_LIBRARY: Path to libEGL.so.</p><p class="MsoNormal">EGL_opengl_LIBRARY: Path to libOpenGL.so.</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">> How can I visually debug the output of the EGL rendering?</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Currently, we don't support an on-screen rendering with EGL.</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Utkarsh</p><p class="MsoNormal"><u></u> <u></u></p></span></div></div><br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>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" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>