Qt QGraphicsScene保存为图片

时间:2021-02-20 12:42:00   收藏:0   阅读:0
1     QImage image(m_Pixmap.width(), m_Pixmap.height(), QImage::Format_RGB888);
2     QPainter painter(&image);
3     m_pGraphicsScene->render(&painter);   //关键函数
4     image.save("D:\\SaveGraphicsScene.bmp");

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!