<div dir="ltr">You can use the VTK way, which will create a ImageData of the captured data.<div><br></div><div><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/Screenshot">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/Screenshot</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 19, 2015 at 5:07 AM, louiskoo <span dir="ltr"><<a href="mailto:419655660@qq.com" target="_blank">419655660@qq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I use the vtkRenderWindow.GetPixelData() to capture RenderWindow screen's<br>
image in C#:<br>
<br>
byte[] vtkScreenBuffer = null;<br>
int imgWidth = 0, imgHeight = 0;<br>
if (vtkScreenBuffer == null)<br>
{<br>
imgWidth = _renwin.GetSize()[0];<br>
imgHeight = _renwin.GetSize()[1];<br>
<br>
<br>
vtkUnsignedCharArray data = vtkUnsignedCharArray.New();<br>
_renwin.GetPixelData(0, 0, imgWidth - 1, imgHeight - 1, 0,<br>
data);<br>
<br>
int s = 3 * (int)data.GetNumberOfTuples();<br>
vtkScreenBuffer = new byte[s];<br>
}<br>
IntPtr ptr = _renwin.GetPixelData(0, 0, imgWidth - 1, imgHeight<br>
- 1, 0);<br>
Marshal.Copy(ptr, vtkScreenBuffer, 0, vtkScreenBuffer.Length);<br>
<br>
<br>
However,I don't know how to realize it in Java. Anyone can give me a idea?<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/java-vtkRenderWindow-GetPixelData-tp5733554.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/java-vtkRenderWindow-GetPixelData-tp5733554.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<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/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_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=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/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div>