QT 将图片缩小显示在QLabel中并居中显示

    ui->direction_label->resize(200,200);//设置label控件大小
    QPixmap pix;
    pix.load(":/img/方向盘.png");
    QPixmap fitpixmap = pix.scaled(50, 50, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
    ui->direction_label->setPixmap(fitpixmap);
    ui->direction_label->setAlignment(Qt::AlignCenter); //居中显示
上一篇:怎样用Python将PDF文件转为图片?


下一篇:思科CCNP学习笔记完整版