最近打算做一个实时显示机器人导航位置和地图的界面,从后台拿到的地图点云怎么显示到界面上,点云来自于bmp文件(灰度图)。
https://www.jianshu.com/p/e010be59f762
QImage image; image.load("https://img-ask.csdn.net/upload/202008/04/1596525841_332711.png"); DrawImage(ui->widget,image);
DrawImage(QWidget *qt_widget, QImage qt_image)
{
QPixmap pix;
labelX->move(0,0);
labelX->resize(qt_widget->width(),qt_widget->height());
labelX->setPixmap(pix.fromImage(qt_image));// ui->pix就是label的控件名字
labelX->setScaledContents(true);
labelX->show();
}