Bei mir bleibt der Wert auf Null.
Quellcode:
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
i,j : Integer;
blackCount: Integer;
begin
blackCount := 0;
for i:= 0 to image1.Picture.Bitmap.Height -1 do
for j:=0 to image1.Picture.Bitmap.Width -1 do
if image1.Picture.Bitmap.Canvas.Pixels[j,i] = clBlack then
inc(blackCount);
Label1.Caption := '';
Label1.Caption := (IntToStr(blackCount));
end;