J
jbas
Unregistered / Unconfirmed
GUEST, unregistred user!
下面的代码不能提取,不知哪位大侠能帮一下我!
我想把边界变成黑色,其余变白色.谢谢了!
simulate是form,pntbx为paintbox。
var
TempColor:Tcolor;
for I:=0 to simulate.pntbx.Width-1 do
begin
for J:=0 to simulate.pntbx.Height-1 do
begin
SBln:=false;
TempColor:=simulate.pntbx.Canvas.Pixels[I,J];
Templcolor:=simulate.pntbx.Canvas.Pixels[I-1,J];
Temprcolor:=simulate.pntbx.Canvas.Pixels[I+1,J];
Temptcolor:=simulate.pntbx.Canvas.Pixels[I,J-1];
Tempdcolor:=simulate.pntbx.Canvas.Pixels[I,J+1];
if (TempColor=Templcolor) or (TempColor=Temprcolor) or (TempColor=Temptcolor) or (TempColor=TempDcolor) then
SBln:=true;
if SBln=true then
simulate.pntbx.Canvas.Pixels[I,J]:=clblack
else
simulate.pntbx.Canvas.Pixels[I,J]:=clwhite;
end;
end;
我想把边界变成黑色,其余变白色.谢谢了!
simulate是form,pntbx为paintbox。
var
TempColor:Tcolor;
for I:=0 to simulate.pntbx.Width-1 do
begin
for J:=0 to simulate.pntbx.Height-1 do
begin
SBln:=false;
TempColor:=simulate.pntbx.Canvas.Pixels[I,J];
Templcolor:=simulate.pntbx.Canvas.Pixels[I-1,J];
Temprcolor:=simulate.pntbx.Canvas.Pixels[I+1,J];
Temptcolor:=simulate.pntbx.Canvas.Pixels[I,J-1];
Tempdcolor:=simulate.pntbx.Canvas.Pixels[I,J+1];
if (TempColor=Templcolor) or (TempColor=Temprcolor) or (TempColor=Temptcolor) or (TempColor=TempDcolor) then
SBln:=true;
if SBln=true then
simulate.pntbx.Canvas.Pixels[I,J]:=clblack
else
simulate.pntbx.Canvas.Pixels[I,J]:=clwhite;
end;
end;