Sign in to follow this  
livingaftermidnight

Getting texture pixel information

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

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