PDA

View Full Version : QImage Pixel Coordinations



strateng
5th May 2010, 07:17
Hey,

I was just wondering if there was a way which you could get a QImage image's pixel coordinates after displaying the image? Or if there is a way to get the coordinates inside the QWidget which the image is being displayed within like QGraphisView?

Thanks,
Strateng

aamer4yu
5th May 2010, 10:47
How are you displaying the image ? If you are using QLabel, you can always map the cordinates from widget to parent or to global...cant you ?
What exactly you want to achieve ?

axeljaeger
6th May 2010, 10:00
There is for sure a way to solve your problem. But I think your approach expecting the position drawn on a screen beeing a property of the image will not work: A QImage is basically a buffer of pixels. It can be drawn on the screen multiple times so it would have to record every single position it was drawn within its lifetime. It can also be drawn transformed and so on. So the position of the image on the screen should be really stored within the component that does the actual drawing on the screen.