Hi All,<br><br>Using the given example of an Image Viewer in Examples/GUI/Qt/ImageViewer, what can I do to fit 2D images of any size to the size of a QVTKWidget?<br><br>Here is the code:<br><br>int main(int argc, char** argv)<br>
{<br>&nbsp; QApplication app(argc, argv);<br><br>&nbsp; QVTKWidget widget;<br>&nbsp; widget.resize(256,256);<br>&nbsp;<br>#if QT_VERSION &lt; 0x040000<br>&nbsp; app.setMainWidget(&amp;widget);<br>#endif<br><br>&nbsp; vtkPNGReader* reader = vtkPNGReader::New();<br>
&nbsp; char* fname = vtkTestUtilities::ExpandDataFileName(argc, argv, &quot;Data/vtk.png&quot;);<br>&nbsp; reader-&gt;SetFileName(fname);<br>&nbsp; delete [] fname;<br><br>&nbsp; vtkImageViewer* image_view = vtkImageViewer::New();<br>&nbsp; image_view-&gt;SetInputConnection(reader-&gt;GetOutputPort());<br>
<br>&nbsp; widget.SetRenderWindow(image_view-&gt;GetRenderWindow());<br>&nbsp; image_view-&gt;SetupInteractor(widget.GetRenderWindow()-&gt;GetInteractor());<br><br>&nbsp; image_view-&gt;SetColorLevel(138.5);<br>&nbsp; image_view-&gt;SetColorWindow(233);<br>
<br>&nbsp; widget.show();<br><br>&nbsp; app.exec();<br>&nbsp; <br><br>&nbsp; image_view-&gt;Delete();<br>&nbsp; reader-&gt;Delete();<br>}<br><br><br>Thanks,<br>Luis<br>