Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How do I convert QImage RGB888 to QImage ARGB?
Forum Updated to NodeBB v4.3 + New Features

How do I convert QImage RGB888 to QImage ARGB?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    prerna1
    wrote on last edited by
    #1

    such that alpha is always 255 or 1 i.e. all pixels are visible.

    1 Reply Last reply
    0
    • N Offline
      N Offline
      NicuPopescu
      wrote on last edited by
      #2

      qt's doc:

      bq. An image's format can be retrieved using the format() function. Use the convertToFormat() functions to convert an image into another format

      the default alpha channel value for each pixel should be 255 ... anyway you can use pixel manipulation to alter the alpha value:

      @value = qRgb(image.pixel(1,1)); // read the pixel color and fill alpha=255
      image.setPixel(1, 1, value);@

      bq. QRgb qRgb ( int r, int g, int b )
      Returns the ARGB quadruplet (255, r, g, b).

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved