PDA

View Full Version : get a ptr of raw data from screen shot



saman_artorious
11th August 2013, 13:16
I get a screen shot with this code:


QPixmap originalPixmap = QPixmap::grabWidget(this);
QImage *image = new QImage(originalPixmap.toImage());
image->save("/home/saman/Desktop/image.png");


Now, I want to send raw data grabbed from grabWidget over the socket. On the other end, machine receives this raw data and creates a gl texture of it.

As you see, the return value of grabWidget is a QPixmap, I also checked the method data_ptr(), which I think returns what I want with DataPtr format. this format is not recognizable by the compiler though! any idea how to resolve this?

anda_skoa
11th August 2013, 13:55
You are looking for QImage::bits()

Cheers,
_