Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Etus

Getting the alpha value in a bitmap

This topic is 5774 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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..."

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!