在VS2019下编译通过,调用海康相机缩放图像OK;
//当前帧/图片按比例缩放,适应QLabel控件大小
QPixmap pixmap = QPixmap::fromImage(srcQImage);
QPixmap fitpixmap = pixmap.scaled(ui.Camera1->width(), ui.Camera1->height(), Qt::KeepAspectRatio, Qt::SmoothTransformation); // 按比例缩放
//QPixmap fitpixmap = pixmap.scaled(ui.Camera1->width(), ui.Camera1->height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation); // 拉伸填满缩放
ui.Camera1->setPixmap(fitpixmap);