vtkImagedata and vtkRenderWindow

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

vtkImagedata and vtkRenderWindow

Bruno Marques
I would like to display an image in a VTK render window and i would like the image to adapt its size to the render window whenever this is resized. Is it possible?
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: vtkImagedata and vtkRenderWindow

David Gobbi-2
If you are using vtkImageActor or vtkImageViewer2 to display the image, then the resize should be
automatic.  Generally these are the two classes
you should use for image display.


If you are using vtkImageMapper or the old vtkImageViewer, then you need
to add an observer for the "StartEvent" of the renderer.  This event is generated immediately
before the renderer updates the pipeline and paints the window.  In the callback for the observer,
you have to resize the
image using a resample filter based on the width and height of the
renderer.

 - David


--- Bruno Marques <[hidden email]> wrote:

> I would like to display an image in a VTK render window and i would like the
> image to adapt its size to the render window whenever this is resized. Is it
> possible?
> > _______________________________________________
> 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
>

_______________________________________________
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