T
thanksall
Unregistered / Unconfirmed
GUEST, unregistred user!
昨天提问钱用完了,这是我同学的帐号
昨天那位说要发邮件的别忘了啊,多谢
procedure tform2.getrgbp(sender:tobject);
var
color:tcolor;
begin
x:=image1.Picture.Width;
xx:=x-1;
y:=image1.Picture.Height;
yy:=y-1;
for i:=0 to xx do
begin
for j:=0 to yy do
begin
color:=image1.Canvas.Pixels[i,j];
rgbpoint[i,j].r:=getrvalue(color);
rgbpoint[i,j].g:=getgvalue(color);
rgbpoint[i,j].b:=getbvalue(color);
end;
end;
end;
procedure Tform2.N6Click(Sender: TObject);
var
red:integer;
green:integer;
blue:integer;
begin
image6.Picture.Bitmap.Assign(image1.Picture.Bitmap);
getrgbp(sender);
xx:=x-2;
yy:=y-2;
for i:=1 to xx do
begin
for j:=1 to yy do
begin
red:=rgbpoint[i-1,j-1].r+rgbpoint[i-1,j].r+rgbpoint[i-1,j+1].r+
rgbpoint[i,j-1].r+rgbpoint[i,j].r+rgbpoint[i,j+1].r+
rgbpoint[i+1,j-1].r+rgbpoint[i+1,j].r+rgbpoint[i+1,j+1].r;
green:=rgbpoint[i-1,j-1].g+rgbpoint[i-1,j].g+rgbpoint[i-1,j+1].g+
rgbpoint[i,j-1].g+rgbpoint[i,j].g+rgbpoint[i,j+1].g+
rgbpoint[i+1,j-1].g+rgbpoint[i+1,j].g+rgbpoint[i+1,j+1].g;
blue:=rgbpoint[i-1,j-1].b+rgbpoint[i-1,j].b+rgbpoint[i-1,j+1].b+
rgbpoint[i,j-1].b+rgbpoint[i,j].b+rgbpoint[i,j+1].b+
rgbpoint[i+1,j-1].b+rgbpoint[i+1,j].b+rgbpoint[i+1,j+1].b;
mybitmap.Canvas.Pixels[i,j]:=rgb(red div 9,green div 9,blue div 9);
end;
end;
image6.Picture.Bitmap.Assign(mybitmap);
end;
昨天那位说要发邮件的别忘了啊,多谢
procedure tform2.getrgbp(sender:tobject);
var
color:tcolor;
begin
x:=image1.Picture.Width;
xx:=x-1;
y:=image1.Picture.Height;
yy:=y-1;
for i:=0 to xx do
begin
for j:=0 to yy do
begin
color:=image1.Canvas.Pixels[i,j];
rgbpoint[i,j].r:=getrvalue(color);
rgbpoint[i,j].g:=getgvalue(color);
rgbpoint[i,j].b:=getbvalue(color);
end;
end;
end;
procedure Tform2.N6Click(Sender: TObject);
var
red:integer;
green:integer;
blue:integer;
begin
image6.Picture.Bitmap.Assign(image1.Picture.Bitmap);
getrgbp(sender);
xx:=x-2;
yy:=y-2;
for i:=1 to xx do
begin
for j:=1 to yy do
begin
red:=rgbpoint[i-1,j-1].r+rgbpoint[i-1,j].r+rgbpoint[i-1,j+1].r+
rgbpoint[i,j-1].r+rgbpoint[i,j].r+rgbpoint[i,j+1].r+
rgbpoint[i+1,j-1].r+rgbpoint[i+1,j].r+rgbpoint[i+1,j+1].r;
green:=rgbpoint[i-1,j-1].g+rgbpoint[i-1,j].g+rgbpoint[i-1,j+1].g+
rgbpoint[i,j-1].g+rgbpoint[i,j].g+rgbpoint[i,j+1].g+
rgbpoint[i+1,j-1].g+rgbpoint[i+1,j].g+rgbpoint[i+1,j+1].g;
blue:=rgbpoint[i-1,j-1].b+rgbpoint[i-1,j].b+rgbpoint[i-1,j+1].b+
rgbpoint[i,j-1].b+rgbpoint[i,j].b+rgbpoint[i,j+1].b+
rgbpoint[i+1,j-1].b+rgbpoint[i+1,j].b+rgbpoint[i+1,j+1].b;
mybitmap.Canvas.Pixels[i,j]:=rgb(red div 9,green div 9,blue div 9);
end;
end;
image6.Picture.Bitmap.Assign(mybitmap);
end;