新人求助,屏幕取色。
IF n=1DECLARE integer GetPixel IN WIN32API as "GetPixel" integer hDc,integer xPos,integer yPos
DECLARE integer GetDC IN WIN32API as "GetDC" integer hWnd
DECLARE integer ReleaseDC IN WIN32API as "ReleaseDC" integer,integer
hDcScreen=GetDC(0)
LOCAL xRgbColor as Integer
xRgbColor=GetPixel(hDcScreen,364,291)
if int(xRgbColor/65536)=255.and.int((xRgbColor%65536)/256)=255.and.xRgbColor%256=255
bls="0"
else
bls="1"
endif
go ff
do case
case fff<101
replace hzb1 with trim(hzb1)+bls
case fff>100.and.fff<201
replace hzb2 with trim(hzb2)+bls
case fff>200.and.fff<301
replace hzb3 with trim(hzb3)+bls
case fff>300
replace hzb4 with trim(hzb4)+bls
endcase
fff=fff+1
thisform.container1.image1.left=thisform.container1.image1.left-24
if fff=401
fff=1
ff=ff+1
thisform.container1.image1.top=thisform.container1.image1.top-24
thisform.container1.image1.left=0
endif
ReleaseDC(0,hDcScreen)
clear dlls
endif
各位老大,这个代码是偶连抄带蒙写出来的。意思就是屏幕取色,写到表里。可执行到第十四条记录失效,怀疑是内存溢出。请各位老大助小弟一臂之力,先谢谢了。