<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:宋体;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:新宋体;
        panose-1:2 1 6 9 3 1 1 1 1 1;}
@font-face
        {font-family:"\@宋体";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"\@新宋体";
        panose-1:2 1 6 9 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
/* Page Definitions */
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;
        layout-grid:15.6pt;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=ZH-CN link=blue vlink=purple style='text-justify-trim:punctuation'>
<div class=Section1 style='layout-grid:15.6pt'>
<p class=MsoNormal><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'>hey all, <o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:21.0pt'><font size=1 face=Arial><span
lang=EN-US style='font-size:9.0pt;font-family:Arial'>I’m using the </span></font><font
size=1 face=新宋体><span lang=EN-US style='font-size:9.0pt;font-family:新宋体'>vtkWindowToImageFilter
class for the screen shot to a image file. I used VS2005, vtk 4.1 under the
windowXP. <o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:21.0pt'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-indent:21.0pt'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>Here is my code: <o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:21.0pt'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'><o:p> </o:p></span></font></p>
<p class=MsoNormal align=left style='text-align:left;text-autospace:none'><font
size=1 face=新宋体><span lang=EN-US style='font-size:9.0pt;font-family:新宋体'> vtkRenderWindow*
pRenderWindow = pWindow->getRenderWindow();<o:p></o:p></span></font></p>
<p class=MsoNormal align=left style='text-align:left;text-autospace:none'><font
size=1 face=新宋体><span lang=EN-US style='font-size:9.0pt;font-family:新宋体'><o:p> </o:p></span></font></p>
<p class=MsoNormal align=left style='text-align:left;text-autospace:none'><font
size=1 face=新宋体><span lang=EN-US style='font-size:9.0pt;font-family:新宋体'> vtkWindowToImageFilter*
pWindowToImageFilter = vtkWindowToImageFilter::New();<o:p></o:p></span></font></p>
<p class=MsoNormal align=left style='text-align:left;text-autospace:none'><font
size=1 face=新宋体><span lang=EN-US style='font-size:9.0pt;font-family:新宋体'> pWindowToImageFilter->SetInput(pRenderWindow);<o:p></o:p></span></font></p>
<p class=MsoNormal align=left style='text-align:left;text-autospace:none'><font
size=1 face=新宋体><span lang=EN-US style='font-size:9.0pt;font-family:新宋体'> pWindowToImageFilter->Update();<o:p></o:p></span></font></p>
<p class=MsoNormal align=left style='text-align:left;text-autospace:none'><font
size=1 face=新宋体><span lang=EN-US style='font-size:9.0pt;font-family:新宋体'><o:p> </o:p></span></font></p>
<p class=MsoNormal align=left style='text-align:left;text-autospace:none'><font
size=1 face=新宋体><span lang=EN-US style='font-size:9.0pt;font-family:新宋体'> vtkBMPWriter*
pBMPWriter = vtkBMPWriter::New();<o:p></o:p></span></font></p>
<p class=MsoNormal align=left style='text-align:left;text-autospace:none'><font
size=1 face=新宋体><span lang=EN-US style='font-size:9.0pt;font-family:新宋体'> pBMPWriter->SetInputConnection(pWindowToImageFilter->GetOutputPort());<o:p></o:p></span></font></p>
<p class=MsoNormal align=left style='text-align:left;text-autospace:none'><font
size=1 face=新宋体><span lang=EN-US style='font-size:9.0pt;font-family:新宋体'> pBMPWriter->SetFileName(<font
color=maroon><span style='color:maroon'>"C:\\ExportRenderWindow2BMP.jpg"</span></font>);<o:p></o:p></span></font></p>
<p class=MsoNormal align=left style='text-align:left;text-autospace:none'><font
size=1 face=新宋体><span lang=EN-US style='font-size:9.0pt;font-family:新宋体'><o:p> </o:p></span></font></p>
<p class=MsoNormal align=left style='text-align:left;text-autospace:none'><font
size=1 face=新宋体><span lang=EN-US style='font-size:9.0pt;font-family:新宋体'> pRenderWindow->Render();<o:p></o:p></span></font></p>
<p class=MsoNormal align=left style='text-align:left;text-autospace:none'><font
size=1 face=新宋体><span lang=EN-US style='font-size:9.0pt;font-family:新宋体'> pWindowToImageFilter->Modified();<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:21.0pt'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'>pBMPWriter->Write();<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:21.0pt'><font size=1 face=新宋体><span
lang=EN-US style='font-size:9.0pt;font-family:新宋体'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-indent:21.0pt'><font size=1 face=Arial><span
lang=EN-US style='font-size:9.0pt;font-family:Arial'>When the render image size
smaller than the screen size, in the other words, when you can see the whole image
in the screen, these code work fine;<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:21.0pt'><font size=1 face=Arial><span
lang=EN-US style='font-size:9.0pt;font-family:Arial'>But, when the render image
size bigger than the screen size, in the other words, after zoom in, when you
can only see a part of the image, you can only get what you see, the saved image
size is same to screen’s size. <o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:21.0pt'><font size=1 face=Arial><span
lang=EN-US style='font-size:9.0pt;font-family:Arial'>I want to get the whole image
data to image file, who can help me, thanks for any advice!<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:21.0pt'><font size=1 face=Arial><span
lang=EN-US style='font-size:9.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-indent:21.0pt'><font size=1 face=Arial><span
lang=EN-US style='font-size:9.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-indent:21.0pt'><font size=1 face=Arial><span
lang=EN-US style='font-size:9.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-indent:21.0pt'><font size=1 face=Arial><span
lang=EN-US style='font-size:9.0pt;font-family:Arial'><o:p> </o:p></span></font></p>
</div>
</body>
</html>