//Ersin Kecis. 19/11/2004. ersinkecis@hotmail.com
procedure TForm1.BitBtn1Click(Sender: TObject);
var i,j:integer;
r:longint;
begin
for i:=1 to image1.Height do
begin
for j:=1 to image1.Width do
begin
r:=round((getrvalue(image1.Canvas.Pixels[i,j])+getbvalue(image1.Canvas.Pixels[
i,j])+getgvalue(image1.Canvas.Pixels[i,j]))/3);
image2.Canvas.Pixels[i,j]:=rgb(r,r,r);
end;
end;
end;
//Kaynak: Hatice Duman kardesimiz... :)