QImage image; image.load(fileName);//fileName为图片的路径

QImage result = image.scaled(800, 600).scaled(120, 180, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);//放缩图片,以固定大小显示

ImageLabel->setPixmap(QPixmap::fromImage(result));//在Label控件上显示图片

 

相关文章:

  • 2021-04-14
  • 2021-11-19
  • 2022-12-23
  • 2022-02-11
  • 2022-03-06
  • 2021-10-23
猜你喜欢
  • 2021-06-17
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
相关资源
相似解决方案