Sign in to follow this  
EFileTahi-A

Reading pixels from a surface

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

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