1.

  

 QImage Image;
    Image.load(":/images/f1.png");
    QPixmap pixmap = QPixmap::fromImage(Image);
    int with = secene->width ();//要显示的宽度
    int height =secene->height ();
    QPixmap fitpixmap = pixmap.scaled(with, height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);  // 饱满填充
    //QPixmap fitpixmap = pixmap.scaled(with, height, Qt::KeepAspectRatio, Qt::SmoothTransformation);  // 按比例缩放

    view->setBackgroundBrush(fitpixmap);

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-29
  • 2022-02-28
猜你喜欢
  • 2021-08-22
  • 2021-06-17
  • 2021-04-17
  • 2021-11-10
  • 2021-05-27
  • 2021-10-07
  • 2021-07-20
相关资源
相似解决方案