• Advertisement

Archived

This topic is now archived and is closed to further replies.

? About Locking Surfaces, and reading pixels

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

If I have a surface (it''s a bitmap), and I want to check the color of each pixel on the surface, I would have though you do this (correct me where I''m wrong): Lock the surface, get the height, width, pitch, and surfacepointer, then loop through, checking each pixel. I think I''m doing that correctly, but I''m obviously missing something. What am I missing? Also, when I lock a surface, is there any advantage (speed-wise) to only locking the rectangle I want to look at, rather than the whole surface? (it''s not the primary surface) Thanks, Nutts

Share this post


Link to post
Share on other sites
Advertisement
Just checking inside the rect taht you want to look at is a teeny weeny speed boost due to the fact that it wont be reading pixel from the whole image but just from that little section.

Share this post


Link to post
Share on other sites

  • Advertisement