[vtkusers] How to avoid black screen at the end of animation?
rakesh patil
prakeshofficial at gmail.com
Wed Jan 11 08:10:27 EST 2012
Hi folks,
Here is a small piece of code to create animation file (*.avi) file with
the help of vtkAVIWriter
vtkWindowToImageFilter *windowToImage = vtkWindowToImageFilter::New();
windowToImage->SetInput(pRenderWindow );
windowToImage->SetInputBufferTypeToRGBA();
vtkAVIWriter *avw = vtkAVIWriter::New();
avw->SetInputConnection(windowToImage->GetOutputPort());
avw->SetFileName("animation.avi");
avw->SetQuality(2);
avw->SetRate((int)srate);
avw->Start();
double tIter = startIndex;
while(tIter <= endIndex)
{
/* Code to Display Results (Contours and/or vectors) */
windowToImage->Modified();
avw->Write();
/* Code to increment the counter */
tIter += timeStep;
}
avw->End();
avw->Delete();
windowToImage->Delete();
Using this simple code, I am able to generate animation (video) file. When
I wanted to present this animation in powerpoint, it so happened that, full
animation played without any problem. And at the end of the movie, instead
of stopping at the last frame, it showing black screen.
Can any one of you help me to overcome this problem?
Thanks in advance
Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120111/cd637ff6/attachment.htm>
More information about the vtkusers
mailing list