Sreenivas Murali
Sreenivas Murali

Reputation: 83

Qt applcation Scribble- accessing pixel location

I am working on this Qt app called scribble. Below is the link

http://doc.qt.io/qt-4.8/qt-widgets-scribble-example.html

I am new to Qt. I want to store the pixel locations of the scribbles(drawn using my mouse pointer) that I draw as [i],[j] values (2d values) and pass them to another function. Where can I access the pixel values ?

Upvotes: 0

Views: 36

Answers (1)

vicrion
vicrion

Reputation: 1743

You need to refer to QImage image; variable to read the pixel data of that scribble example. So, if you have pixel coordinates [i][j], then use pixel() method:

QRgb rgb = image.pixel(i, j);

Upvotes: 1

Related Questions