I am working on a program that will scan the screen for a certain color. I made a code that will scan, but it is too slow. Is there anything else i can use instead of GetPixel()? Or is any other way I can speed this up. If it helps at all I am using Visual Basic C++ and my computer is Windows 7. Here's my code:

for (int X = 7; X < 100; X++){
for (int Y = 22; Y < 200; Y++){
if(GetPixel(hDC, X, Y) == ChampOrcColor) {
::MessageBox(NULL, _T("Orc Found"), _T("Search Success"), MB_OK);
X = 748;
Y = 415;
I = 2;}}}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.