Results 1 to 2 of 2

Thread: Showing 1 bit binary PNG as 32bit RGBA image

  1. #1
    Join Date
    Mar 2012
    Location
    India
    Posts
    102
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Showing 1 bit binary PNG as 32bit RGBA image

    Hi,

    I have a 1 bit binary png which needs to be shown on the GUI as 32 bit RGBA. I have done the loading of the image in a QImage and then converting the format. How to multiply the 1 bits with a color and keep the 0's as transparent ?

    Thanks,
    Charvi

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Showing 1 bit binary PNG as 32bit RGBA image

    Iterate over QImage::bits(), multiply. Transparent pixels have 0 as their alpha channel value, multiplying won't change that.

    Cheers,
    _

Similar Threads

  1. Replies: 3
    Last Post: 10th May 2014, 00:44
  2. Sequence of RGBA channels in DDS
    By maxoutlaw in forum Qt Programming
    Replies: 8
    Last Post: 16th September 2012, 21:38
  3. Showing Image
    By InterFiction in forum Newbie
    Replies: 5
    Last Post: 24th November 2011, 05:26
  4. Qt ARGB and RGBA
    By zack in forum Qt Programming
    Replies: 1
    Last Post: 19th January 2010, 21:44
  5. Replies: 3
    Last Post: 14th March 2007, 08:09

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.