• 7400阅读
  • 1回复

使用Qlabel显示图片 [复制链接]

上一主题 下一主题
离线liujia_310
 
只看楼主 倒序阅读 楼主  发表于: 2009-04-18
我使用
QImage qImage (label->width(), label->height(),QImage::Format_RGB32);
  qImage.load("d:\\37.png");
label->setPixmap(QPixmap::fromImage(qImage));

但图片只能显示一半 ,还有部分没有显示
请问怎样才能让图片全部显示在label区域内???
离线lazybone
只看该作者 1楼 发表于: 2009-04-18
label.setScaledContents(true); // 图像自动填充

public final void setScaledContents(boolean arg__1)
This property holds whether the label will scale its contents to fill all available space. When enabled and the label shows a pixmap, it will scale the pixmap to fill the available space.
快速回复
限100 字节
 
上一个 下一个