Thread: Rendering 32-bit images - alpha is ignored

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Math wizard
    Join Date
    Dec 2006
    Location
    USA
    Posts
    582

    Rendering 32-bit images - alpha is ignored

    I loaded a TGA image with alpha channel used (32-bit color) but for some reason, the alpha channel is ignored when displaying the image. The normal colors are correct, but areas fully transparent (cannot be seen) are all black and fully visible (as if alpha was 255) and the semitransparent areas have the colors drawn as is, but with the alpha at 255. I made sure I set up the BITMAPINFOHEADER struct properly (32 for the .biBitCount value for one), but that didn't work at all. Each pixel has it's own alpha value. I took a screenshot of the original image and what is being displayed, if that helps to explain.

    See screenshot

    The top window shows my program and the way the image is displayed in it. The bottom is what the original looks like. The checkerboard pattern background indicates transparent areas (for those not familiar with the program). The area in focus is the snow-capped peak with the peak on the furthest left (the short mountain). Note the lack of alpha channel usage in my program for that same area.

    How do I get it so I get the alpha channel to be used rather than ignored.

    Edit: I'm using DrawDibDraw if that helps.
    Last edited by ulillillia; 04-15-2007 at 02:57 AM. Reason: Link mistake and a small note

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 32 bit color depth bitmap problem with XP
    By kalabala in forum C++ Programming
    Replies: 0
    Last Post: 12-22-2008, 06:56 AM
  2. binary numbers
    By watshamacalit in forum C Programming
    Replies: 4
    Last Post: 01-14-2003, 11:06 PM
  3. 16 bit or 32 bit
    By Juganoo in forum C Programming
    Replies: 9
    Last Post: 12-19-2002, 07:24 AM
  4. 32 bit or 16 ???
    By GiraffeMan in forum C Programming
    Replies: 11
    Last Post: 04-24-2002, 12:56 PM
  5. Array of boolean
    By DMaxJ in forum C++ Programming
    Replies: 11
    Last Post: 10-25-2001, 11:45 PM