[vtkusers] Stretching and shrinking 2D images

julien.barneoud at kodak.com julien.barneoud at kodak.com
Thu Jun 2 10:21:17 EDT 2005


Hi all,

I am trying to stretch or shrink an image to fit the window size. 
- When sizing its parent window, I also size the render window to make it 
have the same size as its parent. 
- I am using a vtkImageMapper and a vtkActor2D to display the image into 
the render window. I have enabled RenderToRectangle functionnality into 
the vtkImageMapper , and set correct Position (0.0 0.0) and Position2 (1.0 
1.0) of the vtkActor2D.

When I resize the window, making it larger than the raw image dimension, 
the image is well stretched, but if I reduce the size of the window to 
something smaller than the raw image size, the image is not shrunk to fit 
the window size: it is displayed with a 1.0 zoom factor (and so, only a 
part of the image is visible).

Is there any possibility to shrink a 2D image using vtkImageMapper and 
vtkActor2D, or should I use another set of classes ?

Thanks in advance for your help.

Regards,

Julien BARNEOUD
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050602/b3068687/attachment.htm>


More information about the vtkusers mailing list