<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face="Times New Roman" size=2>Dear all,</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2></FONT> </DIV>
<DIV><FONT face="Times New Roman" size=2> I encounter a question, I
want to display many pieces of image using vtkImageData and vtkImageActor. But
when I render them, only one image is displayed. How to display them
automatically in a for cycle? Thanks a lot. Here is my code in
OnDraw(CDC* pDC):</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2></FONT> </DIV>
<DIV><FONT face="Times New Roman" size=2> ....</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2>vtkRenderer *ren =
vtkRenderer::New();</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2>vtkRenderWindow *renWin =
vtkRenderWindow::New();</FONT></DIV>
<DIV><FONT face="Times New Roman"
size=2>renWin->AddRenderer(ren);</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2></FONT> </DIV>
<DIV><FONT face="Times New Roman" size=2>vtkImageData *ImageData =
vtkImageData::New();</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2>
ImageData->SetScalarTypeToUnsignedChar();</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2>
ImageData->SetExtent(0,255,0,2550,0);</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2>
ImageData->AllocateScalars();</FONT></DIV>
<DIV><FONT size=2>vtkImageActor *ImageActor = vtkImageActor::New();</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT face="Times New Roman" size=2> int i,j,k;</FONT></DIV>
<DIV><FONT face="Times New Roman"
size=2> for(i=0;i<72;i++){</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2>
for(j=0;j<256;j++)</FONT></DIV>
<DIV><FONT face="Times New Roman"
size=2>
for(k=0;k<256;k++)</FONT></DIV>
<DIV><FONT face="Times New Roman"
size=2>
ImageData->GetPointData()->GetScalars()->SetTuple1(j*256+k,
image[i][j][k]);</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2>
ImageActor->SetInput(ImageData);</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2>
ren->AddActor(ImageActor);</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2>
renWin->Render();</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2>}</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2></FONT> </DIV></BODY></HTML>