[vtkusers] how can I add a 2D image to the render window
vidyadhar
vidyadhar at lucidindia.net
Wed Jan 11 23:18:03 EST 2006
Hi,
I think the problem is with vtk's rendering order - 3D geometry, volumes and
then 2D actors (I think so). I think you are using one renderer only. For 2D
actor, you can set the viewport region bounds occupied by the actor. A
better approach might be to use two renderers in different layers. You can
get better control over rendering order by changing AddRenderer order. You
can also set viewport size for renderer which gets the 2D actor (logo) and
explicitly switch off that renderer's interactive mode. Layer order of
renderer will be vtk version dependent, so you will have to experiment a
little bit about that.
HTH
Vidyadhar
----- Original Message -----
From: "Jesse Corrington" <corrington_j at hotmail.com>
To: <vtkusers at vtk.org>
Sent: Wednesday, January 11, 2006 2:36 AM
Subject: Re: [vtkusers] how can I add a 2D image to the render window
> I tried calling render, and now i see nothing in the render window, not
even
> the volume that should be there. Also, with this 2d image i want it to
not
> be effected by interaction from the user. I just want a static image in
the
> corner with our company logo, this way when the user takes a snapshot it
> will be there. Any other ideas to get this working. The help is much
> appreciated. Thanks
>
>
> >From: David Cole <david.cole at kitware.com>
> >To: Jesse Corrington <corrington_j at hotmail.com>
> >CC: vtkusers at vtk.org
> >Subject: Re: [vtkusers] how can I add a 2D image to the render window
> >Date: Tue, 10 Jan 2006 15:44:50 -0500
> >
> >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
> >>
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today - it's FREE!
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>
>
More information about the vtkusers
mailing list