Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to figure out if bitmap has an alpha channel

How to figure out if bitmap has an alpha channel

Scheduled Pinned Locked Moved C / C++ / MFC
graphicstutorial
3 Posts 3 Posters 0 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.
  • A Offline
    A Offline
    Andre xxxxxxx
    wrote on last edited by
    #1

    I need to figure out if a HBITMAP/CBitmap has an alpha channel, but bitmap.bmBitsPixel is always 32, no matter if it's a 16-color bitmap or 24-bit+alpha channel bitmap.

    M J 2 Replies Last reply
    0
    • A Andre xxxxxxx

      I need to figure out if a HBITMAP/CBitmap has an alpha channel, but bitmap.bmBitsPixel is always 32, no matter if it's a 16-color bitmap or 24-bit+alpha channel bitmap.

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      I don't think DDBs support alpha channel, at least not in the standard Windows APIs.

      1 Reply Last reply
      0
      • A Andre xxxxxxx

        I need to figure out if a HBITMAP/CBitmap has an alpha channel, but bitmap.bmBitsPixel is always 32, no matter if it's a 16-color bitmap or 24-bit+alpha channel bitmap.

        J Offline
        J Offline
        Joe Woodbury
        wrote on last edited by
        #3

        One way is to see if there are any non-zero values in the alpha channel. If so, they it likely has one, though this is definitely not exact.

        Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups