Prepsal jsem to:
1. Na zacatku Handle
2. Pomoci Case=Proveruji se jenom dve podminky.
Presto je rychlost prekreslovani asi 14FPS.
procedure TForm1.Timer3Timer(Sender: TObject);
var
c:TCanvas;
begin
c:=TCanvas.create;
c.handle:=GetWindowDC(GetDesktopWindow);
case n of
0 : begin
if (ColorToHTMLHex(getpixel(c.handle, 613 , 441 )))='FF0000' then n:= 2 ;
end;
2 : begin
if (ColorToHTMLHex(getpixel(c.handle, 613 , 442 )))='FF0000' then n:= 0 ;
if (ColorToHTMLHex(getpixel(c.handle, 612 , 440 )))='FF0000' then n:= 4 ;
end;
4 : begin
if (ColorToHTMLHex(getpixel(c.handle, 613 , 441 )))='FF0000' then n:= 2 ;
if (ColorToHTMLHex(getpixel(c.handle,612 , 439 )))='FF0000' then n:= 6 ;
end;
6 : begin
if (ColorToHTMLHex(getpixel(c.handle, 612 , 440 )))='FF0000' then n:= 4 ;
if (ColorToHTMLHex(getpixel(c.handle,611 , 438 )))='FF0000' then n:= 7 ;
end;
7 : begin
if (ColorToHTMLHex(getpixel(c.handle, 612 , 439 )))='FF0000' then n:= 6 ;
if (ColorToHTMLHex(getpixel(c.handle,611 , 437 )))='FF0000' then n:= 9 ;
end;
9 : begin
if (ColorToHTMLHex(getpixel(c.handle, 611 , 438 )))='FF0000' then n:= 7 ;
if (ColorToHTMLHex(getpixel(c.handle,611 , 436 )))='FF0000' then n:= 11 ;
end;
11 : begin
if (ColorToHTMLHex(getpixel(c.handle, 611 , 437 )))='FF0000' then n:= 9 ;
if (ColorToHTMLHex(getpixel(c.handle, 611 , 435 )))='FF0000' then n:= 13 ;
end;
13 : begin
if (ColorToHTMLHex(getpixel(c.handle , 611 , 436 )))='FF0000' then n:= 11 ;
if (ColorToHTMLHex(getpixel(c.handle, 611 , 434 )))='FF0000' then n:= 15 ;
end;
15 : begin
if (ColorToHTMLHex(getpixel(c.handle, 611 , 435 )))='FF0000' then n:= 13 ;
if (ColorToHTMLHex(getpixel(c.handle, 611 , 433 )))='FF0000' then n:= 17 ;
end;
17 : begin
if (ColorToHTMLHex(getpixel(c.handle, 611 , 434 )))='FF0000' then n:= 15 ;
if (ColorToHTMLHex(getpixel(c.handle,611 , 432 )))='FF0000' then n:= 19 ;
end;
19 : begin
if (ColorToHTMLHex(getpixel(c.handle, 611 , 433 )))='FF0000' then n:= 17 ;
if (ColorToHTMLHex(getpixel(c.handle,611 , 431 )))='FF0000' then n:= 20 ;
end;
20 : begin
if (ColorToHTMLHex(getpixel(c.handle, 611 , 432 )))='FF0000' then n:= 19 ;
if (ColorToHTMLHex(getpixel(c.handle,612 , 430 )))='FF0000' then n:= 22 ;
end;
22 : begin
if (ColorToHTMLHex(getpixel(c.handle, 611 , 431 )))='FF0000' then n:= 20 ;
if (ColorToHTMLHex(getpixel(c.handle,612 , 429 )))='FF0000' then n:= 24 ;
.
.
.
.
.
.
.
end;
98 : begin
if (ColorToHTMLHex(getpixel(c.handle, 639 , 439 )))='FF0000' then n:= 96 ;
if (ColorToHTMLHex(getpixel(c.handle,638 , 441 )))='FF0000' then n:= 100 ;
end;
100 : begin
if (ColorToHTMLHex(getpixel(c.handle, 639 , 440 )))='FF0000' then n:= 98 ;
end;
end;
c.free;
label12.caption:=inttostr(n);
end;