Getting the alpha value in a bitmap

Started by
5 comments, last by Etus 21 years, 4 months ago
Hey, In NeHe''s tutorials, he uses the Glaux header file in order to load bitmaps images. But, this method doesn''t retrieves the alpha value of the bitmap. Is there a way to load a bitmap with the Glaux header file, and also get the alpha value(so it''ll be RGBA)? Thanks, Yuval
Advertisement
Bitmap files don''t have alpha channels. You can however.. load 2 bitmaps (on 24-bit with color information and the other 8-bit with the alpha information) and merge them together in memory, and use that. I would recommend looking into a file that stores an alpha channel natively though, like TGA or something similar.

Billy - BillyB@mrsnj.com
Try the TGA tutorial here:
http://www.gametutorials.com/Tutorials/opengl/OpenGL_Pg2.htm

------------
MSN: nmaster42@hotmail.com, AIM: LockePick42, ICQ: 74128155
"It''s all part of the conspiracy of conspirators conspiring to conspire their own conspiracies..."
_______________________________________Pixelante Game Studios - Fowl Language
C''mon, guys... bitmaps can''t contain alpha channel information? What do you think the purpose of 32-bit bitmap files is?

16 or 32-bit TGA''s can contain alpha, 32-bit ping''s can contain alpha, and 32-bit bitmaps can contain alpha information.
quote:Original post by Ready4Dis
Bitmap files don't have alpha channels.

windows doesn't know that bitmaps can have alpha channels.

however, if you use 32-bit bitmaps, you can safely store alpha in them, and windows will just ignore it. you can generate a 32-bit bitmap with alpha channel, or load one from e.g. png file, then feed it to e.g. opengl, and the transparency bits will be left intact.

edit: although i can't be bothered to test it, good software (including windows' LoadImage) should read all bitmap bits as is, including the alpha channel (windows will see those bits as "reserved").

[edited by - niyaw on December 1, 2002 12:38:00 AM]
Is it possible to load 32-bit bitmaps with the Glaux library?

- Yuval
The GLE32V2 library provides this capability.

[edited by - Ferdinand the Bull on December 4, 2002 2:32:40 PM]

This topic is closed to new replies.

Advertisement