Sign in to follow this  
deftware

Alternative to GetPixel

Recommended Posts

I'm trying to read portions of the desktop in my program, but I am unsure as to how to go about doing this in a manner that is faster than using GetPixel for each individual pixel. At one point I was grabbing a rectangle using BitBlt and storing it into a BITMAP, but that was equally slow. The windows magnifier program (start->programs->accessories->accessibility) seems to do it virtually instantly, but I figured that maybe it's not actually reading the screen data into memory that the program itself accesses, eg: it's simply blitting video memory around, instead of to system memory. Thanks.

Share this post


Link to post
Share on other sites
You can't successfull use GetPixel for any amount of bulk image processing.
It's like wanting to buy 1 cup of rice by repeatedly going to the shop to buy a single grain, carrying that home, and going back to the shop to buy the next grain... etc
I.e. It takes forever because it has such a high overhead per call. A BitBlt on the other hand would usually be very fast. If the bit-depths of the bitmaps are different etc then it can slow down a litle, but it still shouldn't be close to as slow as GetPixel calls unless you perhaps were using it for a very small area.

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