Results 1 to 3 of 3

Thread: QImage Pixel Coordinations

  1. #1
    Join Date
    Mar 2010
    Posts
    28
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QImage Pixel Coordinations

    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

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QImage Pixel Coordinations

    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 ?

  3. #3
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: QImage Pixel Coordinations

    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.
    It's nice to be important but it's more important to be nice.

Similar Threads

  1. Shifting a QImage up by 1 pixel row
    By MSUdom5 in forum Qt Programming
    Replies: 2
    Last Post: 7th May 2010, 10:25
  2. Exception (crash) when accessing QImage pixel
    By TheJim01 in forum Newbie
    Replies: 2
    Last Post: 19th February 2010, 21:53
  3. Multithreaded per pixel operations on QImage
    By N¤X in forum Qt Programming
    Replies: 8
    Last Post: 14th September 2009, 12:29
  4. QImage-Greyscale-8-bits-pixel
    By Ivan Labrador in forum Newbie
    Replies: 5
    Last Post: 3rd August 2008, 00:08
  5. QPixmap pixel by pixel ?
    By tommy in forum Qt Programming
    Replies: 19
    Last Post: 3rd December 2007, 22:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.