Czesc. Napisalem taka funkcje, porwnoje ona dwie bitmapy i jesli sa roznice to okresla w jakim polu (prostokat) znajduja sie roznice. Dziala rewelacyjnie. Ale przy bitmapach o rozdzielczosci 1152x864 czas wykonywania funkcji to srednio 2,5 sekundy a to dla mnie stanowczo za duzo. Czy ktos ma propozycje jak jeszcze mozna porownac bitmaapy? Oczywiscie z okresleniem zakresu od x-x i od y-y róznic.
function GetDifference(Img1, Img2:TImage; var XStart, XStop, YStart, YStrop:integer):boolean;
var
x, y:integer;
TheSame:boolean;
begin
TheSame:=true;
for y:=0 to Img1.Picture.Bitmap.Height do for x:=0 to Img1.Picture.Bitmap.Width do begin
if Img1.picture.Bitmap.Canvas.Pixels[x,y]<>Img2.picture.Bitmap.Canvas.Pixels[x,y] then begin
if TheSame or (XStart>X) then XStart:=X;
if TheSame or (XStop<X) then XStop:=X;
if TheSame or (YStart>Y) then YStart:=Y;
if TheSame or (YStrop<Y) then YStrop:=Y;
TheSame:=false;
end;
end;
result:=not TheSame;
end;