pattern matching on screen

Hello,
I want to match a perticular pattern(predefined crop within the screen-NOT picture box/imagebox)

OR

find the R,G,B values of predefined coordinates and then compare with predefined rgb value.
for example i use the following, but its not working correctly:

Dim ldc As Long
ldc = GetWindowDC(0)

agl1 = GetPixel(ldc, 230, 534)

Red1 = agl1 Mod 256
Green1 = (agl1 \ 256) Mod 256
Blue1 = (agl1 \ 65536) Mod 256

[442 byte] By [Ani] at [2008-1-28]