[vtkusers] Error while converting vtkWin32OpenGLRenderWindow to image file !

sudeep M. Hooli Sudeep.Hooli at quest-global.com
Sat Jul 9 09:18:51 EDT 2005


Hi all,
            I am new to VTK. I am trying to convert the
vtkWin32OpenGLRenderWindow to an image file. 
            I have written the following code in VC++. When I execute
the code, memory error will occur.
If I go for converting vtkRenderWindow with the same code it works fine.
 
Please guide me how to solve this.
 
Code is as follows:
 
int*   size   = this->renWin->GetSize();
 
            //Setup memory rendering
            this->renWin->SetupMemoryRendering( size[0], size[1],
this->GetDC()->m_hAttribDC);
            this->renWin->Render();
 
            vtkWindowToImageFilter * ImageFilter  =
vtkWindowToImageFilter::New();
            ImageFilter->SetInput(this->renWin);
            ImageFilter->Update();
 
            vtkBMPWriter* bmpWriter=vtkBMPWriter::New();
            bmpWriter->SetInput(ImageFilter->GetOutput());
            bmpWriter->SetFileName("c:\\image.bmp");
            bmpWriter->Write();
 
            ImageFilter->Delete();
            bmpWriter->Delete();
            this->renWin->ResumeScreenRendering();
 
            in above code "renWin" is an instance of
vtkWin32OpenGLRenderWindow.
 
Thanks & Regards,
Sudeep.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050709/71ea0b69/attachment.htm>


More information about the vtkusers mailing list