1: 40xif(findimage) x25 циклов результат 2.5 секунд (картинка 12*13)
CODE:
win w;
int Xv, Yv;
r: if (getkeystate(BACK)!=1){ goto r;}
getmouse(Xv, Yv);
w=getwindow(1, Xv, Yv);
w.widthclient = 320;
w.heightclient = 480;
moveclient(w);
int timeA=0; int timeB=0;
int color=2097;int B[320][480];int home[1000][1000];loadimage (#home[0][0], "C:\accounts\home.bmp");
timeA=gettime();int PosX[1];int PosY[1];
for(int er=0; er<25; er++){
screen(#B[0][0],w.leftclient ,w.topclient , w.leftclient+320,w.topclient+480,-1);
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
}
int difference=timeB-timeA;
messagebox(difference);
int Xv, Yv;
r: if (getkeystate(BACK)!=1){ goto r;}
getmouse(Xv, Yv);
w=getwindow(1, Xv, Yv);
w.widthclient = 320;
w.heightclient = 480;
moveclient(w);
int timeA=0; int timeB=0;
int color=2097;int B[320][480];int home[1000][1000];loadimage (#home[0][0], "C:\accounts\home.bmp");
timeA=gettime();int PosX[1];int PosY[1];
for(int er=0; er<25; er++){
screen(#B[0][0],w.leftclient ,w.topclient , w.leftclient+320,w.topclient+480,-1);
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
if(findimage(1, #home[0][0], 0, #PosX[0], #PosY[0], 0, 0, 320, 480,5, 5, 5, 5, 5, 5, 100, 0, #B[0][0])>=1){timeB=gettime();}
}
int difference=timeB-timeA;
messagebox(difference);
2: 1000 Циклов Scanpixel в окне. Результат 16.6 секунд
CODE:
win w;
int Xv, Yv;
r: if (getkeystate(BACK)!=1){ goto r;}
getmouse(Xv, Yv);
w=getwindow(1, Xv, Yv);
w.widthclient = 320;
w.heightclient = 480;
moveclient(w);
int timeA=0; int timeB=0;
int color=2097;int B[320][480];int home[1000][1000];loadimage (#home[0][0], "C:\accounts\home.bmp");
timeA=gettime();int PosX[1];int PosY[1];
for(int er=0; er<1000; er++){
if(scanpixel(249, 402, color, 5, 5, 5, 5, 5, 5, w)==1){}
timeB=gettime();
}
int difference=timeB-timeA;
messagebox(difference);
int Xv, Yv;
r: if (getkeystate(BACK)!=1){ goto r;}
getmouse(Xv, Yv);
w=getwindow(1, Xv, Yv);
w.widthclient = 320;
w.heightclient = 480;
moveclient(w);
int timeA=0; int timeB=0;
int color=2097;int B[320][480];int home[1000][1000];loadimage (#home[0][0], "C:\accounts\home.bmp");
timeA=gettime();int PosX[1];int PosY[1];
for(int er=0; er<1000; er++){
if(scanpixel(249, 402, color, 5, 5, 5, 5, 5, 5, w)==1){}
timeB=gettime();
}
int difference=timeB-timeA;
messagebox(difference);
Дело в том, что работаю над примитивными андроид игрухами. ТАм и сканпикселем можно обойтись, думал перейти на него чтобы обойти нарезку. Но хорошо, что не начал переходить.
Есть мысли по этому поводу?