
24.04.2013, 14:22
|
Новичок
|
|
Регистрация: 25.12.2011
Сообщения: 75
Репутация: 10
|
|
C TBitmap тоже не работает(((, Если не в потоке, а просто процедурой то все ок, а в потоке не в какую ПОЧЕМУ!!!! Изв Ините имоции...
Садись, два
Код:
...
type
TCapth = class(TThread)
protected
procedure Execute; override;
end;
...
ImageSrav:array [3..53] of TBitmap;
...
for I := 3 to 52 do
begin
ImageSrav[i]:=TBitmap.Create;
ImageSrav[i]:=TImage(Form1.FindComponent('Image'+IntToStr(i))).Picture.Bitmap;
end;
...
procedure TCapth.execute;
var
i,x,y,l,j,iz:integer;
s:integer;
stop:Boolean;
cap:String;
proz,posx,posy,all:Integer;
begin
inherited;
cap:='';
for posx := 3 to 77 do begin
for posy := 3 to 15 do begin
s:=0;
iz:=2;
repeat
iz:=iz+1;
all:=0;
s:=0;
proz:=0;
x:=ImageSrav[iz].Width-1;
y:=ImageSrav[iz].Height-1;
for l := 0 to x do begin
for j := 0 to y do begin
if ImageSrav[iz].Canvas.Pixels[l,j]<>RGB(255,255,255) then begin
all:=all+1;
end;
end;
end;
for l := 0 to x do begin
for j := 0 to y do begin
if (ImageSrav[iz].Canvas.Pixels[l,j]=ImageSrav[53].Canvas.Pixels[l+posx,j+posy]) and
(ImageSrav[iz].Canvas.Pixels[l,j]<>RGB(255,255,255)) then
begin
s:=s+1;
end;
end;
end;
proz:=round(s/all*100);
if proz>60 then begin
case iz of
3..7:cap:=cap+'0';
8..12:cap:=cap+'1';
13..17:cap:=cap+'2';
18..22:cap:=cap+'3';
23..27:cap:=cap+'4';
28..32:cap:=cap+'5';
33..37:cap:=cap+'6';
38..42:cap:=cap+'7';
43..47:cap:=cap+'8';
48..52:cap:=cap+'9';
end;
end;
until iz=52;
end;
end;
Form1.sEdit2.Text:=cap;
end;
|