如果完全匹配的话,可以从
src dst
function samepic(src: TImage; i, j: Integer; dst: TImage): Boolean;
var
k,m: Integer;
begin
for k := i to i+dst.width do
for m := j to j + dst.Height do
begin
if src.Canvas.Pixels[k,m] <> dst.Canvas.Pixels[k-i,m-j] then
begin
Result := False;
Exit;
end;
end;
Result ;= True;
end;
function HasPic(src, dst: TImage)Boolean;
var
I, J:Integer;
begin
for I := 0 to src.width - dst.width do
for J := 0 to dst.height - dst.height do
begin
if src.Canvas.Pixels[i,j] <> dst.Canvas.Pixels[0,0] then
begin
if samepic(src, i, j, dst) then
begin
Result := True;
Exit;
end;
end;
end;