Sign in to follow this  

Getting texture pixel information

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

This topic is 4536 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this