Показать сообщение отдельно
  #2  
Старый 29.04.2011, 09:37
Janom Janom вне форума
Начинающий
 
Регистрация: 04.02.2011
Адрес: Москва
Сообщения: 148
Версия Delphi: 7
Репутация: 133
По умолчанию

Кол-во пикселей:
Код:
procedure TForm1.Button1Click(Sender: TObject);
var
  CurvCol:TColor;
  i,j,pxCount:Cardinal;
begin
CurvCol:=RGB(0,0,0);
pxCount:=0;
Image1.Canvas.FillRect(Image1.ClientRect);
Image1.Canvas.Pen.Color:=CurvCol;
Image1.Canvas.LineTo(Image1.Width,Image1.Height);
for i:=0 to Image1.Width do
    for j:=0 to Image1.Height do
        if Image1.Canvas.Pixels[i,j]=CurvCol then pxCount:=pxCount+1;
Form1.Caption:=IntToStr(pxCount);
end;
Ответить с цитированием