<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi guys,</p>
<p><br>
</p>
<p>I want to save screenshot as png image following the example. Unfortunately, the code went into
<span style="font-family: Calibri, Arial, Helvetica, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', NotoColorEmoji, 'Segoe UI Symbol', 'Android Emoji', EmojiSymbols; font-size: 16px;">
windowToImageFilter->Update()</span> method and never came back. Below is the snippet:</p>
<p><br>
</p>
<p></p>
<div>// Screenshot  </div>
<div>    vtkSmartPointer<vtkWindowToImageFilter> windowToImageFilter =</div>
<div>        vtkSmartPointer<vtkWindowToImageFilter>::New();</div>
<div>    windowToImageFilter->SetInput(renderWindow);</div>
<div>    //windowToImageFilter->SetMagnification(3); //set the resolution of the output image (3 times the current resolution of vtk render window)</div>
<div>    //windowToImageFilter->SetInputBufferTypeToRGBA(); //also record the alpha (transparency) channel</div>
<div>    //windowToImageFilter->ReadFrontBufferOff(); // read from the back buffer</div>
<div>    windowToImageFilter->Update();</div>
<div><br>
</div>
<div>    vtkSmartPointer<vtkPNGWriter> writer =</div>
<div>        vtkSmartPointer<vtkPNGWriter>::New();</div>
<div>    writer->SetFileName("e:/screenshot2.png");</div>
<div>    writer->SetInputConnection(windowToImageFilter->GetOutputPort());</div>
<div>    writer->Write();</div>
<div><br>
</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>renderWindow->Render();</div>
<div>    timerLog->MarkEvent("finish rendering");</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>renderWindowInteractor->Start();</div>
<br>
<p></p>
<p>I am using win10, vtk6.3 on vc2013. </p>
<p><br>
</p>
<p>Any tips would be appreciated.</p>
<p><br>
</p>
<p>Cheers,</p>
<p><br>
</p>
<p>Chiang</p>
</div>
</body>
</html>