Reading pixels from a surface

Started by
-1 comments, last by EFileTahi-A 15 years, 9 months ago
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
"Sometimes you may think you're alone but that's not true, where ever you go, Death is always near and always watching you." By me January 2007

This topic is closed to new replies.

Advertisement