Retrieving Pixel RGB
Is there anyone who knows how to retreive the RGB value of a pixel from 16bit DirecDraw4 surface?
Thanks.
1. Check pixel format (RGB565, ARGB1555, ARGB4444 etc)
2. Get a pointer to the pixelmemory by locking the surface.
3. Find the right pixel with x*2 + y*pitch
4. retrieve the RGB values from the WORD
for format RGB565:
The red component is the 5 most significant bits
The green component is the next 6 bits
The blue component is the 5 least significat bits
2. Get a pointer to the pixelmemory by locking the surface.
3. Find the right pixel with x*2 + y*pitch
4. retrieve the RGB values from the WORD
for format RGB565:
The red component is the 5 most significant bits
The green component is the next 6 bits
The blue component is the 5 least significat bits
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement