Jump to content
  • Advertisement
Sign in to follow this  
livingaftermidnight

Getting texture pixel information

This topic is 4749 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

Is there a way to load a 32-bit bmp and be able to loop through every pixel and check it's RGB values and get it's XY coords? I would like to store these values so that if the R value is at a certain amount I can spawn a particle (from my particle effects system) at that X and Y coordinate.

Share this post


Link to post
Share on other sites
Advertisement
I'm guessing you are using Windows GDI (If not tell me what you are using..)

use the LoadBitmap() for loading a bitmap (supports 32 bit) from a file or a resource. This is the simpliest way I know for loading bitmaps. Look for more complexed and more supportive methods in the Win32 SDK.

To look at each pixel's rgb data use the GetDIBits() method. (Explaind in the Win32 SDK)

If there is something with the functions above you don't understand , post it and i'll try to explain the best I can.

Have fun ;)

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.

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!