procedure TForm1.Button2Click(Sender: TObject);
var
p:pbytearray;
x,y:integer;
bmp:tbitmap;
begin
bmp:=tbitmap.Create;
bmp.Assign(form1.Image1.Picture.Bitmap);
bmp.PixelFormat:=pf24bit;
for y:=0 to bmp.Height-1 do
begin
p:=bmp.ScanLine[y];
for x:=0 to bmp.Width-1 do
begin
if (p[3*x+2]=0) and (p[3*x+1]=0) and (p[3*x]=0) then
//p[3*x+2]=0) and (p[3*x+1]=0) and (p[3*x]=0) 就是代表黑色
begin
edit1.Text:=inttostr(x);
edit2.Text:=inttostr(y); // 这就记录下来了~
end;
end;
end;
end;