在label中添加pixmap来显示图片时,当图片过大时图片显示不全。
1.这时可以使用pixmap的scared()方法,来设置图片缩放。
QPixmap QPixmap.scaled (self, int w, int h, Qt.AspectRatioMode aspectMode = Qt.IgnoreAspectRatio, Qt.TransformationMode mode = Qt.FastTransformation)
Scales the pixmap to the given size, using the aspect ratio and transformation modes specified by aspectRatioMode and transformMode.
- If aspectRatioMode is Qt.IgnoreAspectRatio, the pixmap is scaled to size.
- If aspectRatioMode is