views:

152

answers:

2

i made a program that uses the colors of pixels from the screen but getpixel is slow so is there a better way to find the color of pixels. i don't care if i get the full screen or one pixel at a time but the main thing is speed.

A: 

This depends entirely on what you need to do. If you only need one pixel, then use GetPixel--it may be slow, but who cares when you only need one? If you are trying to capture a whole region of the screen, though, then there are screen capture APIs you can use. Once you have the screen capture, you can pick out whatever pixels you want.

JSBangs
A: 

BitBlt is pretty fast. It also allows you to specify a region to be copied, so you don't have to copy pixels you don't want.

Zach Johnson