QLabel加载图片

//在对应的控件中显示图片
void qm_img::DisplayImg(cv::Mat imgParam, QLabel *labelParam)
{
    if (!imgParam.empty())
    {
        cv::Mat img_index1 = imgParam.clone();
        //cvtColor(img_index1, img_index1, cv::COLOR_BGR2RGB);
        QImage qimg1 = Mat2QImage(img_index1);
        labelParam->clear();
        //labelParam->setScaledContents(true);
        labelParam->setPixmap(QPixmap::fromImage(qimg1));
        //labelParam->resize(labelParam->pixmap()->size());
        labelParam->show();
    }
}

 

相关文章:

  • 2021-04-29
  • 2021-11-06
  • 2021-05-23
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-13
猜你喜欢
  • 2021-05-16
  • 2021-07-20
  • 2022-12-23
  • 2021-03-29
  • 2022-12-23
  • 2022-12-23
  • 2021-08-19
相关资源
相似解决方案