How do I get a pixel's color from a surface?

Started by
1 comment, last by s_cloudx 22 years, 2 months ago
I need to pass a pixel (and it''s color) to an array from a surface. How do I do that?
--------------------------Sony "Mr. Valdez" ValdezPinoyforum.net Technical EditorPinoyforum.net - the breeding ground of the Filipino Computer Talents
Advertisement
Use IDirect3DSurface8::LockRect.
---visit #directxdev on afternet <- not just for directx, despite the name
If you know the x and y cords then use GetLockedPixel to return the colour, just make sure to lock/unlock the surface.

eg.

  Surface.lockArray[x][y]=Surface.GetLockedPixel(x,y);Surface.unlock  


in Psudocode.

,Jay

This topic is closed to new replies.

Advertisement