<div dir="ltr"><div>Hi Willy,</div><div><br></div><div>Instead of copying to the .NET windows bitmap you can just connect the renderwindow to the picturebox with the following:</div><div><br></div><div>m_renwin->SetParentId(panelVtk->Handle.ToPointer());<br></div><div><br></div><div><br></div><div>Donny Z.</div><div><br></div><div><br></div><br style="font-size:12.8px"><div dir="ltr" style="font-size:12.8px"><div class="gmail-m_-8879015530201995687markdown-here-wrapper" style="font-family:verdana,arial,sans-serif;color:rgb(11,83,148)"><p style="margin:0px 0px 1.2em">Hi Willy,</p><p style="margin:0px 0px 1.2em">You need to call <code style="font-size:0.95em;font-family:consolas,inconsolata,courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(218,218,218);background-color:rgb(232,232,232);border-radius:3px;display:inline">Modified()</code> on the vtkImageData, each time you update it, for the volume mapper to reload the volume.</p><p style="margin:0px 0px 1.2em">Hope that helps.</p><p style="margin:0px 0px 1.2em">Sankhesh</p><div title="MDH:SGkgV2lsbHksPGRpdj48YnI+PC9kaXY+PGRpdj5Zb3UgbmVlZCB0byBjYWxsIGBNb2RpZmllZCgp
YCBvbiB0aGUgdnRrSW1hZ2VEYXRhLCBlYWNoIHRpbWUgeW91IHVwZGF0ZSBpdCwgZm9yIHRoZSB2
b2x1bWUgbWFwcGVyIHRvIHJlbG9hZCB0aGUgdm9sdW1lLjwvZGl2PjxkaXY+PGJyPjwvZGl2Pjxk
aXY+SG9wZSB0aGF0IGhlbHBzLjwvZGl2PjxkaXY+PGJyPjwvZGl2PjxkaXY+U2Fua2hlc2g8L2Rp
dj4=" style="height:0px;width:0px;max-height:0px;max-width:0px;overflow:hidden;font-size:0em;padding:0px;margin:0px"></div></div></div><br style="font-size:12.8px"><div class="gmail_quote" style="font-size:12.8px"><div dir="ltr">On Mon, Feb 13, 2017 at 8:42 AM Willy <<a href="mailto:Wiggerl@linhuber.info" target="_blank">Wiggerl@linhuber.info</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thanks for your reply, but i think i described my problem not detailed<br class="gmail-m_-8879015530201995687gmail_msg">enough.<br class="gmail-m_-8879015530201995687gmail_msg"><br class="gmail-m_-8879015530201995687gmail_msg">I don't use vtkRenderWindowInteractor. I have a .NET project with .Net<br class="gmail-m_-8879015530201995687gmail_msg">PictureBox in it and a C++ Project witch encapsulates all the vtk stuff. To<br class="gmail-m_-8879015530201995687gmail_msg">show the rendered vtk image in my picturebox i set my vtkRenderWindow to<br class="gmail-m_-8879015530201995687gmail_msg">OffScreenRenderingOn() and use the following method to Convert vtkImageData<br class="gmail-m_-8879015530201995687gmail_msg">to a .NET Bitmap:<br class="gmail-m_-8879015530201995687gmail_msg"><br class="gmail-m_-8879015530201995687gmail_msg">void VolumeRenderer::Render3DImage(<wbr>int width, int height, Bitmap^% image)<br class="gmail-m_-8879015530201995687gmail_msg">{<br class="gmail-m_-8879015530201995687gmail_msg">    _RenderWindow->SetSize(width, height);<br class="gmail-m_-8879015530201995687gmail_msg">    _CurrentRenderer-><wbr>ResetCameraClippingRange();<br class="gmail-m_-8879015530201995687gmail_msg">    vtkRenderLargeImage* imageFilter = vtkRenderLargeImage::New();<br class="gmail-m_-8879015530201995687gmail_msg">    imageFilter->SetInput(_<wbr>CurrentRenderer);<br class="gmail-m_-8879015530201995687gmail_msg">    imageFilter->SetMagnification(<wbr>1);<br class="gmail-m_-8879015530201995687gmail_msg">    imageFilter->Update();<br class="gmail-m_-8879015530201995687gmail_msg">    ConvertRGBVTKImageToBitmap(<wbr>imageFilter->GetOutput(), image);<br class="gmail-m_-8879015530201995687gmail_msg">    imageFilter->Delete();<br class="gmail-m_-8879015530201995687gmail_msg">}<br class="gmail-m_-8879015530201995687gmail_msg"><br class="gmail-m_-8879015530201995687gmail_msg">Each time the user moves the mouse, changes the color, ... i change the<br class="gmail-m_-8879015530201995687gmail_msg">Position/Rotation of the camera or the vtkColorTransferFunction or wathever.<br class="gmail-m_-8879015530201995687gmail_msg">And after that i recall Render3DImage to get the new Picture which i show in<br class="gmail-m_-8879015530201995687gmail_msg">my PictureBox. After the very first call of Render3DImage the rendered image<br class="gmail-m_-8879015530201995687gmail_msg">does not change anymore if i change the data in my vtkImageData (using<br class="gmail-m_-8879015530201995687gmail_msg">memcpy). i guess that the very first call of Render3DImage copies my<br class="gmail-m_-8879015530201995687gmail_msg">cpu-Memory (where vtkImageData is) to the gpu. If a change the vtkImageData<br class="gmail-m_-8879015530201995687gmail_msg">after that it does not affect the gpu-memory.<br class="gmail-m_-8879015530201995687gmail_msg">Am i rigth? what can i do?<br class="gmail-m_-8879015530201995687gmail_msg"><br class="gmail-m_-8879015530201995687gmail_msg"><br class="gmail-m_-8879015530201995687gmail_msg"><br class="gmail-m_-8879015530201995687gmail_msg">--<br class="gmail-m_-8879015530201995687gmail_msg">View this message in context: <a href="http://vtk.1045678.n5.nabble.com/vtkGPUVolumeRayCastMapper-Updateing-ImageData-after-first-Rendering-tp5742153p5742159.html" rel="noreferrer" class="gmail-m_-8879015530201995687gmail_msg" target="_blank">http://vtk.1045678.n5.nabble.<wbr>com/vtkGPUVolumeRayCastMapper-<wbr>Updateing-ImageData-after-<wbr>first-Rendering-<wbr>tp5742153p5742159.html</a><br class="gmail-m_-8879015530201995687gmail_msg">Sent from the VTK - Users mailing list archive at Nabble.com.<br class="gmail-m_-8879015530201995687gmail_msg">______________________________<wbr>_________________<br class="gmail-m_-8879015530201995687gmail_msg">Powered by <a href="http://www.kitware.com/" rel="noreferrer" class="gmail-m_-8879015530201995687gmail_msg" target="_blank">www.kitware.com</a><br class="gmail-m_-8879015530201995687gmail_msg"><br class="gmail-m_-8879015530201995687gmail_msg">Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" class="gmail-m_-8879015530201995687gmail_msg" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br class="gmail-m_-8879015530201995687gmail_msg"><br class="gmail-m_-8879015530201995687gmail_msg">Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" class="gmail-m_-8879015530201995687gmail_msg" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br class="gmail-m_-8879015530201995687gmail_msg"><br class="gmail-m_-8879015530201995687gmail_msg">Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" class="gmail-m_-8879015530201995687gmail_msg" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br class="gmail-m_-8879015530201995687gmail_msg"><br class="gmail-m_-8879015530201995687gmail_msg">Follow this link to subscribe/unsubscribe:<br class="gmail-m_-8879015530201995687gmail_msg"><a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" class="gmail-m_-8879015530201995687gmail_msg" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a></blockquote></div></div>