[vtkusers] how can I add a 2D image to the render window

David Cole david.cole at kitware.com
Tue Jan 10 15:44:50 EST 2006


Did you try calling vtkRenderWindow::Render after the AddActor2D call? 
It's not automatic, so that you can do many AddActor calls in a row and 
then call Render at the end...

HTH,
David

Jesse Corrington wrote:

> I am trying to add a 2D image to the render window, and nothing is 
> showing up. What am i doing wrong. Thanks
>
> //add vg logo
> char fullPath[512];
> sprintf(fullPath, "%s/vglogo.bmp", directory.c_str());
>
> vtkImageReader *reader = vtkImageReader::New();
> reader->SetFileName("vglogo.bmp");
> reader->Update();
>
> vtkImageMapper *mapper = vtkImageMapper::New();
> mapper->SetInput(reader->GetOutput());
>
> vgLogo = vtkActor2D::New();
> vgLogo->SetMapper(mapper);
> pvtkRenderer->AddActor2D(vgLogo);
>
> _________________________________________________________________
> Don’t just search. Find. Check out the new MSN Search! 
> http://search.msn.click-url.com/go/onm00200636ave/direct/01/
>
> _______________________________________________
> This is the private VTK discussion list. Please keep messages 
> on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list