procedure TForm1.CheckBox9Click(Sender: TObject);
VAR
Bitmap1: TBitmap;
Bitmap2: TBitmap;
PixelsDiffer: INTEGER;
PixelsMatch : INTEGER;
PixelsTotal : INTEGER;
a,b,c,d,e:real;
begin
Bitmap1 := TBitmap.Create;
Bitmap2 := TBitmap.Create;
TRY
Bitmap1.LoadFromFile('2.bmp');
Bitmap2.LoadFromFile('3.bmp');
CompareBitmaps(Bitmap1, Bitmap2, PixelsTotal, PixelsMatch, PixelsDiffer);
a:=strtofloat(Format('%d',[PixelsTotal]));
b:=strtofloat(Format('%d',[PixelsMatch]));
c:=strtofloat(Format('%d',[PixelsDiffer]));
d:=b/a*100;
edit1.Text:=floattostr(Round(d));
e:=c/a*100;
edit2.Text:=floattostr(Round(e));
FINALLY
Bitmap1.Free;
Bitmap2.Free
END
end;