program new; {.include srl/srl.scar} function FindAllBitmapsIn(TheBmp,startx,starty,endx,endy:integer):array of tpoint; var tmpbool:boolean; AL:integer; curx,cury,tmpx,tmpy,height:integer; begin tmpbool:=FindBitmapIn(TheBmp,tmpx,tmpy,startx,starty,endx,endy); if tmpbool then begin curx:=startx; cury:=starty; /////auto height finder/////// tmpbool:=FindBitmapIn(TheBmp,tmpx,tmpy,startx,starty,endx,endy); height:=0; repeat height:=height+1; tmpbool:=FindBitmapIn(TheBmp,tmpx,tmpy,startx,tmpy,endx,tmpy+height); until tmpbool; //writeln('height '+inttostr(height)); /////////// repeat tmpbool:=FindBitmapIn(TheBmp,tmpx,tmpy,curx,cury,endx,cury+height); if tmpbool then begin curx:=tmpx+1; AL:=getarraylength(result); setarraylength(result,AL+1); result[AL].x:=tmpx; result[AL].y:=tmpy; end; if not tmpbool then begin curx:=startx; cury:=cury+1; end; until cury=endy+1; end; end; var PlayerDot:integer; mytpa:array of tpoint; iter:integer; begin PlayerDot := BitmapFromString(4, 5, 'z78DA3330000137570434C010' + '8140576710C41471310241B026435723107436054188880102182' + '28B0000E71C1BCB'); iter:=getsystemtime; mytpa:=FindAllBitmapsIn(PlayerDot,mmx1,mmy1,mmx2,mmy2); writeln(inttostr(getsystemtime-iter)+'ms'); writeln(inttostr(getarraylength(mytpa))+' dots'); end.