<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.3020" name=GENERATOR>
<STYLE>@font-face {
font-family: ЛОМе;
}
@font-face {
font-family: РВЛОМе;
}
@font-face {
font-family: @ЛОМе;
}
@font-face {
font-family: @РВЛОМе;
}
@page Section1 {size: 595.3pt 841.9pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; layout-grid: 15.6pt; }
P.MsoNormal {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify
}
LI.MsoNormal {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify
}
DIV.MsoNormal {
TEXT-JUSTIFY: inter-ideograph; FONT-SIZE: 10.5pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; TEXT-ALIGN: justify
}
A:link {
COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
COLOR: windowtext; FONT-FAMILY: Arial; mso-style-type: personal-compose
}
DIV.Section1 {
page: Section1
}
</STYLE>
</HEAD>
<BODY lang=ZH-CN style="TEXT-JUSTIFY-TRIM: punctuation" vLink=purple link=blue
bgColor=#ffffff>
<DIV><FONT face=Arial size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: Arial">hey all,
<o:p></o:p></SPAN></FONT></DIV>
<DIV class=Section1 style="LAYOUT-GRID: 15.6pt none">
<P class=MsoNormal style="TEXT-INDENT: 21pt"><FONT face=Arial size=1><SPAN
lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial">IЎЇm using the
</SPAN></FONT><FONT face=РВЛОМе size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; 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: 21pt"><FONT face=РВЛОМе size=1><SPAN
lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: РВЛОМе"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="TEXT-INDENT: 21pt"><FONT face=РВЛОМе size=1><SPAN
lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: РВЛОМе">Here is my code:
<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="TEXT-INDENT: 21pt"><FONT face=РВЛОМе size=1><SPAN
lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: РВЛОМе"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left><FONT face=РВЛОМе
size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: РВЛОМе">
vtkRenderWindow* pRenderWindow =
pWindow->getRenderWindow();<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left><FONT face=РВЛОМе
size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: РВЛОМе"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left><FONT face=РВЛОМе
size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: РВЛОМе">
vtkWindowToImageFilter* pWindowToImageFilter =
vtkWindowToImageFilter::New();<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left><FONT face=РВЛОМе
size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: РВЛОМе">
pWindowToImageFilter->SetInput(pRenderWindow);<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left><FONT face=РВЛОМе
size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: РВЛОМе">
pWindowToImageFilter->Update();<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left><FONT face=РВЛОМе
size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: РВЛОМе"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left><FONT face=РВЛОМе
size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: РВЛОМе"> vtkBMPWriter*
pBMPWriter = vtkBMPWriter::New();<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left><FONT face=РВЛОМе
size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: РВЛОМе">
pBMPWriter->SetInputConnection(pWindowToImageFilter->GetOutputPort());<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left><FONT face=РВЛОМе
size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; 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 style="TEXT-ALIGN: left" align=left><FONT face=РВЛОМе
size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: РВЛОМе"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left><FONT face=РВЛОМе
size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: РВЛОМе">
pRenderWindow->Render();<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="TEXT-ALIGN: left" align=left><FONT face=РВЛОМе
size=1><SPAN lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: РВЛОМе">
pWindowToImageFilter->Modified();<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="TEXT-INDENT: 21pt"><FONT face=РВЛОМе size=1><SPAN
lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: РВЛОМе">pBMPWriter->Write();<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="TEXT-INDENT: 21pt"><FONT face=РВЛОМе size=1><SPAN
lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: РВЛОМе"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="TEXT-INDENT: 21pt"><FONT face=Arial size=1><SPAN
lang=EN-US style="FONT-SIZE: 9pt; 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: 21pt"><FONT face=Arial size=1><SPAN
lang=EN-US style="FONT-SIZE: 9pt; 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: 21pt"><FONT face=Arial size=1><SPAN
lang=EN-US style="FONT-SIZE: 9pt; 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: 21pt"><FONT face=Arial size=1><SPAN
lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="TEXT-INDENT: 21pt"><FONT face=Arial size=1><SPAN
lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="TEXT-INDENT: 21pt"><FONT face=Arial size=1><SPAN
lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P>
<P class=MsoNormal style="TEXT-INDENT: 21pt"><FONT face=Arial size=1><SPAN
lang=EN-US
style="FONT-SIZE: 9pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></FONT></P></DIV></BODY></HTML>