setScaledContents

ui->catchPhotoLabel_607->setPixmap(QPixmap::fromImage(*m_imageCatchtDefaultPhoto_607).scaled(QSize(200, 210), Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
    ui->catchPhotoLabel_607->setScaledContents(true);  //图片自适应大小

猜你喜欢

转载自www.cnblogs.com/huangfuyuan/p/11673087.html