如何访问指向 QWidget 像素的指针

How to access to pointer to pixels of a QWidget

本文关键字:QWidget 像素 指针 何访问 访问      更新时间:2023-10-16

我想不断更新QWidget的像素。

为此,我需要访问指向 QWidget 像素的原始指针。

我已经知道涂装线等,但这些对我的工作来说不是很好和有效。

QImage就是

你要找的东西。您必须使用QLabel并使用setPixmap方法在其中添加QImage

QImage myImage;
QLabel myLabel;
myLabel.setPixmap(QPixmap::fromImage(myImage));