K
kjzzn
Unregistered / Unconfirmed
GUEST, unregistred user!
代码如下:
procedure TForm1.BitBtn1Click(Sender: TObject);
var
i,j:integer;
b:TBitmap;
ePointSourceDistance,eLsouble;
begin
self.Label1.Caption:=inttostr(GetTickCount);
InitSourceList;
InitFrequencyWindow;
InitDEMCeedts;
for j:=0 to C_Map_Size_Y-1 do
for i:=0 to C_Map_Size_X-1 do
begin
if (j=1) and (i=125) then
begin
application.ProcessMessages;
end;
ePointSourceDistance:=(SourceList[4].Position.X-i)*(SourceList[4].Position.X-i)+(SourceList[4].Position.Y-j)*(SourceList[4].Position.Y-j);
if ePointSourceDistance=0 then
eLs:=0
else
eLs:=32.44+20*log10(SourceList[4].UsedFrequency[0])+10*log10(ePointSourceDistance)+20*log10(C_Map_Point_Distance);
{保存结果}
DEMCeedts[i*j+i].WindowFrequencyPower[0]:=SourceList[4].TransmittingPower-eLs;
end;
{绘图}
b:=TBitmap.Create;
b.Height:=C_Map_Size_Y;
b.Width:=C_Map_Size_X;
{读出结果}
for j:=0 to C_Map_Size_Y-1 do
begin
for i:=0 to C_Map_Size_X-1 do
begin
if DEMCeedts[i*j+i].WindowFrequencyPower[0]>=6 then
begin
b.Canvas.Pixels[i,j]:=clred;
// s:=s+'3';
end
else
if DEMCeedts[i*j+i].WindowFrequencyPower[0]>=3 then
begin
b.Canvas.Pixels[i,j]:=clYellow;
// s:=s+'2';
end
else
if DEMCeedts[i*j+i].WindowFrequencyPower[0]>=0 then
begin
b.Canvas.Pixels[i,j]:=clGreen;
// s:=s+'1';
end
else
begin
b.Canvas.Pixels[i,j]:=clWhite;
// s:=s+'0';
end;
end;
// self.Memo1.Lines.Append(s);
// s:='';
end;
self.Image1.Picture.Bitmap.Assign(b);
b.Free;
self.Label2.Caption:=inttostr(GetTickCount);
end;
用双循环保存后再读出就发生了变化,本来绘出的图应是箭靶状,出来确是在箭靶上有很多
不规则条纹!
不保存直接使用就没错!
我用D7
请高手指点!!
procedure TForm1.BitBtn1Click(Sender: TObject);
var
i,j:integer;
b:TBitmap;
ePointSourceDistance,eLsouble;
begin
self.Label1.Caption:=inttostr(GetTickCount);
InitSourceList;
InitFrequencyWindow;
InitDEMCeedts;
for j:=0 to C_Map_Size_Y-1 do
for i:=0 to C_Map_Size_X-1 do
begin
if (j=1) and (i=125) then
begin
application.ProcessMessages;
end;
ePointSourceDistance:=(SourceList[4].Position.X-i)*(SourceList[4].Position.X-i)+(SourceList[4].Position.Y-j)*(SourceList[4].Position.Y-j);
if ePointSourceDistance=0 then
eLs:=0
else
eLs:=32.44+20*log10(SourceList[4].UsedFrequency[0])+10*log10(ePointSourceDistance)+20*log10(C_Map_Point_Distance);
{保存结果}
DEMCeedts[i*j+i].WindowFrequencyPower[0]:=SourceList[4].TransmittingPower-eLs;
end;
{绘图}
b:=TBitmap.Create;
b.Height:=C_Map_Size_Y;
b.Width:=C_Map_Size_X;
{读出结果}
for j:=0 to C_Map_Size_Y-1 do
begin
for i:=0 to C_Map_Size_X-1 do
begin
if DEMCeedts[i*j+i].WindowFrequencyPower[0]>=6 then
begin
b.Canvas.Pixels[i,j]:=clred;
// s:=s+'3';
end
else
if DEMCeedts[i*j+i].WindowFrequencyPower[0]>=3 then
begin
b.Canvas.Pixels[i,j]:=clYellow;
// s:=s+'2';
end
else
if DEMCeedts[i*j+i].WindowFrequencyPower[0]>=0 then
begin
b.Canvas.Pixels[i,j]:=clGreen;
// s:=s+'1';
end
else
begin
b.Canvas.Pixels[i,j]:=clWhite;
// s:=s+'0';
end;
end;
// self.Memo1.Lines.Append(s);
// s:='';
end;
self.Image1.Picture.Bitmap.Assign(b);
b.Free;
self.Label2.Caption:=inttostr(GetTickCount);
end;
用双循环保存后再读出就发生了变化,本来绘出的图应是箭靶状,出来确是在箭靶上有很多
不规则条纹!
不保存直接使用就没错!
我用D7
请高手指点!!