Results 1 to 2 of 2

Thread: QPixmap replace white pixels by blacks

  1. #1
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default QPixmap replace white pixels by blacks

    Hey there,

    I have a QPixmap.
    I'd like to replace every single white pixels by black ones.

    How can I do that ?

  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: QPixmap replace white pixels by blacks

    Convert the pixmap into QImage and access each Pixel by QImage::pixel .

    Then you can check if the pixel is white, change it to black

  3. The following user says thank you to aamer4yu for this useful post:

    bunjee (20th August 2008)

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.