QT中图片的比例变换,为了适应控件的大小,采用QImage、QPixmap等绘图设备类提供的scaled()函数,下面是Qt文档对于scaled()函数介绍:
函数原型:
QImage QImage::scaled ( int width, int height, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio, Qt::TransformationMode transformMode = Qt::FastTransformation ) const
This is an overloaded function.
Returns a copy of the image scaled to a rectangle with the given width and height according to the given AspectRatioMode and TransformMode.
If either the width or the height is zero or negative, this function returns a null image.
这是一个重载函数,按照指定的宽和高,根据纵横比(Aspect Ratio)模式和