Reading pixels from a surface
I need to read the pixels' colors inside a the locked surface and return their ARGB value. But I don't have a clue on how to do it, I've posted in other forums but with no luck...
This is what I've learned so far:
int pitch;
Surface s = dxDevice.GetBackBuffer(0, 0, BackBufferType.Mono);
GraphicsStream gs = s.LockRectangle(new Rectangle(0,0,32,32), LockFlags.None, out pitch);
From what I've read, I think the GraphicsStream object will get then a single long number which contains everything from the backbuffer, but I don't understand how do I access a x,y pixel and return their ARGB value from this long number.
Thank you for any help
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement