<p dir="ltr">This example may help<br>
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/FillWindow">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/FillWindow</a><br>
</p>
<div class="gmail_quote">On Feb 25, 2014 12:09 AM, "John Anaia" <<a href="mailto:john.anaia@gmail.com">john.anaia@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">(Sorry for last email without a subject line)<br><br><div>I want to display a PNG image thru vtkImageActor and
vtkInteractorStyleImage on QVTKWidget. Everything works fine except the
image appears too small. How do I make the image appears larger when I
show it the first time without mouse interaction? I tried Dolly but no
effect at all. Someone please recommend a camera function to enlarge the
image? Here is my code<br>
<br> vtkSmartPointer<vtkPNGReader> reader = vtkSmartPointer<vtkPNGReader>:<div>:New();<br><br> QString path = QCoreApplication::applicationDirPath();<br> path.append("/icons/logo.png"); <br> reader->SetFileName((path.toStdString()).c_str());<br>
<br> vtkSmartPointer<vtkImageActor> imgactor = vtkSmartPointer<vtkImageActor>::New();<br> imgactor->SetInput(reader->GetOutput());<br><br> vtkSmartPointer<vtkInteractorStyleImage> isi = <br> vtkSmartPointer<vtkInteractorStyleImage>::New();<br>
gUI.qvtkWidget->GetRenderWindow()->GetInteractor()->SetInteractorStyle(isi);<br><br> // a renderer and render window<br> vtkRenderer *ren1 = vtkRenderer::New();<br> gUI.qvtkWidget->GetRenderWindow()->AddRenderer(ren1);<br>
<br> // add the actor to the scene<br> ren1->AddViewProp(imgactor);<br> ren1->SetBackground(1,1,1); // Background color<br><br> ren1->GetActiveCamera()->Dolly(1.0);<br><br><br>Thank you!<br><br></div>
<div>John<br></div></div></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div>