<div dir="ltr"><div>The following two lines did the trick. The order of two lines also matters!<br><br>  renderer->ResetCamera();<br>  renderer->GetActiveCamera()->Zoom(1.5);<br><br></div>John<br><div><div><div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Feb 24, 2014 at 11:21 PM, Morten Wigen <span dir="ltr"><<a href="mailto:morten.wigen@gmail.com" target="_blank">morten.wigen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hi John,<br>
I asked the same thing the other day without any response. If you figure it out, I would appreciate if you gave me a heads up!<br>
<br>
Morten<br>
<br>
> Den 25. feb. 2014 kl. 06:08 skrev John Anaia <<a href="mailto:john.anaia@gmail.com">john.anaia@gmail.com</a>>:<br>
><br>
> (Sorry for last email without a subject line)<br>
><br>
> 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>:<br>
> :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>
> John<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>
</blockquote></div><br></div></div></div></div></div>