[vtkusers] Re: stretch an image to fit in a window
Renaud Isabelle
renauisa at yahoo.fr
Wed May 25 11:29:35 EDT 2005
Hi,
Sorry to bother you again.
I tried what you indicated me to scale my image into a window I passed.
I have no error at compilation. However, my image is not scaled at execution.
Is there any fault in this code:
viewer->SetInput(reader->GetOutput());
vtkRenderer* ren1 = viewer->GetRenderer();
ren1->GetActiveCamera()->ParallelProjectionOn();
ren1->GetActiveCamera()->SetParallelScale(0.5);
//display the image in the frame
viewer->SetParentId(this->m_hWnd);
//execute
viewer->Render();
thanks in advance,
Isabelle
Goodwin Lawlor <goodwin.lawlor at ucd.ie> a écrit:
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" 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
_______________________________________________
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
---------------------------------
Découvrez le nouveau Yahoo! Mail : 1 Go d'espace de stockage pour vos mails, photos et vidéos !
Créez votre Yahoo! Mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050525/35af28c4/attachment.htm>
More information about the vtkusers
mailing list