Jump to content
  • Advertisement
Sign in to follow this  
FernandoLujan

SDL - Altering whole bitmap colors

This topic is 4069 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, guys, first post here in a LONG time. I have this black and white image that I would like to customize in the game, so. I want to be able to alter the red, green, and blue values of the bitmap (basically colorize it). However I was wondering if this was possible in SDL, and if not, how I could go about doing it? Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Check this tutorial, by Lazy Foo

Pixels are stored in a one dimension array, using void*. So you have to convert to the proper pixel format (8, 16, 24 or 32 bits) and access them in the way Lazy Foo explains there. BTW, check the rest of his tutorial, cuz it's very good.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!