[vtkusers] Re: stretch an image to fit in a window

Goodwin Lawlor goodwin.lawlor at ucd.ie
Wed May 25 09:08:33 EDT 2005


Hi Isabelle,

Have a look at this example:

http://www.bioengineering-research.com/vtk/vhpreader.tcl

or

http://www.bioengineering-research.com/vtk/BackgroundImage.tcl


here's the bit you need: (app is an image; numCol and numRow are the image
dims)

vtkImageActor ia
    ia SetInput [app GetOutput]
    ia InterpolateOff
vtkRenderer ren1
    ren1 AddActor ia
    ren1 SetBackground 1 1 1
vtkRenderWindow renWin
    renWin AddRenderer ren1
    renWin SetSize [expr $numCol / 4] [expr $numRow / 4]
vtkInteractorStyleImage istyle
vtkRenderWindowInteractor iren
    iren SetRenderWindow renWin
    iren SetInteractorStyle istyle
    [ren1 GetActiveCamera] ParallelProjectionOn
    #fit the image to the render window
    [ren1 GetActiveCamera] SetParallelScale [expr $numRow / 2]
    renWin Render


hth

Goodwin


"Renaud Isabelle" <renauisa at yahoo.fr> wrote in message
news:20050525115733.8984.qmail at web26108.mail.ukl.yahoo.com...
Hi everyone,

I made a 2D image displayed in a window by using
vtkImageViewer->SetParentId(this->m_hWnd). It works well, but my image is
still displayed with its own dimensions. What I would like to do is find a
way to display it in order to fit the dimensions of my window, something
which could stretch my image.

Could someone suggest me something? I am not sure if it is a VTK or ITK
problem.

By the way, what is the difference between vtkImageViewer and
vtkImageViewer2?

Thanks in advance,

Isabelle


Découvrez le nouveau Yahoo! Mail : 1 Go d'espace de stockage pour vos mails,
photos et vidéos !
Créez votre Yahoo! Mail



_______________________________________________
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