اين هم سورس هيستوگرام براي عاطفه خانم
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Image1: TImage;
Image2: TImage;
Button1: TButton;
procedure Button1Click(Sender: T);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: T);
var i,j,r,g,b,m,h:Integer;
begin
Image2.Width:=64*64;
h:=0;
for i:=0 to 64 do
for j:=0 to 64 do
begin
r:=GetRValue(Image1.Canvas.Pixels[i,j]);
g:=GetGValue(Image1.Canvas.Pixels[i,j]);
b:=GetBValue(Image1.Canvas.Pixels[i,j]);
m:=(r+b+g) div 3;
Image1.Canvas.Pixels[i,j]:=rgb(m,m,m);
Image2.Canvas.Pen.Color:=clred;
Image2.Canvas.MoveTo(h,256);
Image2.Canvas.LineTo(h,Image2.Height-m);
h:=h+1;
end;
end;
end.