Not logged in, Join Here! or Log In Below:  
News Articles Search    

 Home / General Programming / Reading Screen Pixels Account Manager
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.

May 17, 2005, 03:26 AM

I need a fast (and easy) method to read the pixels on the screen (no fullscreen mode) for doing things like takeing screenshots etc.
Right now i use the good old GDI-GetPixel().
I was wondering if there are better and faster methods.

thx in advance for replying


May 17, 2005, 04:27 AM

With LockBits (GDI+) or with GetDIBits (GDI) you can get the pixels of a bitmap into a buffer.
You should check with a profiler which one is faster ...


May 17, 2005, 10:33 AM


Using bitBlt is a fast and easy way to capture parts of the screen.
Here is an example on how to do that in VB, the API calls are the same in all languages.


Dr. Necessiter

May 17, 2005, 12:29 PM

While (almost) on the subject, does anybody know what technique FRAPS uses to grab the screen. It's amazingly fast - I couldn't even reproduce the speed programming it myself within my game.


May 19, 2005, 09:37 AM

Thx for all the answers.

I needed to read some screen pixels about 15xsecond and it showed that my computer was able to do that (36xsecond) with the good old GetPixel() method.
While we are on the subject, does anyone know good algorythms/source codes for how to do fast image recognizitions ?
- finding exact image in image
- finding "similar" image in image

This thread contains 5 messages.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.