• Advertisement
Sign in to follow this  

Reading pixels from a surface

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

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

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement