|
End;
End
else if pgD=3 then
Begin
Form1.Image1.Canvas.Pen.Color:=colGr2;
krok:=1/(10*kd);
dx:=0;
x:=Trunc(Form1.Image1.Width/2);
dy:=fy2D(dx);
y:=Trunc(Form1.Image1.Height/2-dy*(kd*10));
Form1.Image1.Canvas.MoveTo(x,y);
while x<Form1.Image1.Width do
Begin
dx:=dx+krok;
x:=x+1;
dy:=fy2D(dx);
y:=Trunc(Form1.Image1.Height/2-dy*(kd*10));
Form1.Image1.Canvas.LineTo(x,y);
End;
dx:=0;
x:=Trunc(Form1.Image1.Width/2);
dy:=fy2D(dx);
y:=Trunc(Form1.Image1.Height/2-dy*(kd*10));
Form1.Image1.Canvas.MoveTo(x,y);
while x>0 do
Begin
dx:=dx-krok;
x:=x-1;
dy:=fy2D(dx);
y:=Trunc(Form1.Image1.Height/2-dy*(kd*10));
Form1.Image1.Canvas.LineTo(x,y);
End;
End
End;
Procedure DrawAxesD;
Var DADi:integer;
Begin
Form1.Image1.Canvas.Pen.Color:=colAx;
Form1.Image1.Canvas.MoveTo(0,Trunc(Form1.Image1.Height/2));
Form1.Image1.Canvas.LineTo(Form1.Image1.Width,Trunc(Form1.Image1.Height/2));
Form1.Image1.Canvas.MoveTo(Trunc(Form1.Image1.Width/2),0);
Form1.Image1.Canvas.LineTo(Trunc(Form1.Image1.Width/2),Form1.Image1.Height);
Form1.Image1.Canvas.MoveTo(Form1.Image1.Width,Trunc(Form1.Image1.Height/2));
Form1.Image1.Canvas.LineTo(Form1.Image1.Width-10,Trunc(Form1.Image1.Height/2)-6);
Form1.Image1.Canvas.MoveTo(Form1.Image1.Width,Trunc(Form1.Image1.Height/2));
Form1.Image1.Canvas.LineTo(Form1.Image1.Width-10,Trunc(Form1.Image1.Height/2)+6);
Form1.Image1.Canvas.MoveTo(Trunc(Form1.Image1.Width/2),0);
Form1.Image1.Canvas.LineTo(Trunc(Form1.Image1.Width/2)-6,10);
Form1.Image1.Canvas.MoveTo(Trunc(Form1.Image1.Width/2),0);
Form1.Image1.Canvas.LineTo(Trunc(Form1.Image1.Width/2)+6,10);
Form1.Image1.Canvas.Pen.Color:=clSilver;
x:=Trunc(Form1.Image1.Width/2);
DADi:=0;
Form1.Image1.Canvas.TextOut(Trunc(Form1.Image1.Width/2)+3,Trunc(Form1.Image1.Height/2)+3,IntToStr(DADi));
while x<Form1.Image1.Width do
Begin
x:=x+kd*10;
Form1.Image1.Canvas.MoveTo(x,0);
Form1.Image1.Canvas.LineTo(x,Form1.Image1.Height);
DADi:=DADi+1;
Form1.Image1.Canvas.TextOut(x+3,Trunc(Form1.Image1.Height/2)+3,IntToStr(DADi));
End;
x:=Trunc(Form1.Image1.Width/2);
DADi:=0;
while x>0 do
Begin
x:=x-kd*10;
Form1.Image1.Canvas.MoveTo(x,0);
Form1.Image1.Canvas.LineTo(x,Form1.Image1.Height);
DADi:=DADi-1;
Form1.Image1.Canvas.TextOut(x+1,Trunc(Form1.Image1.Height/2)+3,IntToStr(DADi));
End;
y:=Trunc(Form1.Image1.Height/2);
DADi:=0;
while y<Form1.Image1.Height do
Begin
y:=y+kd*10;
Form1.Image1.Canvas.MoveTo(0,y);
Form1.Image1.Canvas.LineTo(Form1.Image1.Width,y);
DADi:=DADi-1;
Form1.Image1.Canvas.TextOut(Trunc(Form1.Image1.Width/2)+2,y+2,IntToStr(DADi));
End;
y:=Trunc(Form1.Image1.Width/2);
DADi:=0;
while y>0 do
Begin
y:=y-kd*10;
Form1.Image1.Canvas.MoveTo(0,y);
Form1.Image1.Canvas.LineTo(Form1.Image1.Width,y);
DADi:=DADi+1;
Form1.Image1.Canvas.TextOut(Trunc(Form1.Image1.Width/2)+2,y+2,IntToStr(DADi));
End
End;
Procedure funcD;
Begin
if Form1.RadioButton1.Checked then fd:=1
else if Form1.RadioButton2.Checked then fd:=2
else if Form1.RadioButton3.Checked then fd:=3
else if Form1.RadioButton4.Checked then fd:=4;
Case fd of
GraficD(1);
GraficD(2);
GraficD(3);
Begin
GraficD(2);
GraficD(3)
End
End;
End;
procedure TForm1.BitBtn2Click(Sender: TObject);
Begin
FonDraw;
if Form1.CheckBox2.Checked=False then DrawAxes else DrawAxesD
End;
procedure TForm1.FormActivate(Sender: TObject);
Begin
colGr1:=clBlue;
colGr2:=clDefault;
colAx:=clRed;
FonDraw;
if Form1.CheckBox2.Checked=False then DrawAxes else DrawAxesD;
kd:=Form1.TrackBar2.Position;
End;
procedure TForm1.TrackBar1Change(Sender: TObject);
Begin
if Form1.CheckBox2.Checked=False then
Begin
FonDraw;
DrawAxes;
Func
End
End;
procedure TForm1.BitBtn1Click(Sender: TObject);
Begin
FonDraw;
if Form1.CheckBox2.Checked=False then
Begin
DrawAxes;
Func
End
Else
Begin
DrawAxesD;
FuncD
End
End;
procedure TForm1.Label4Click(Sender: TObject);
Begin
ShowMessage
End;
procedure TForm1.TrackBar2Change(Sender: TObject);
Begin
kd:=Form1.TrackBar2.Position;
Дата добавления: 2015-10-30; просмотров: 124 | Нарушение авторских прав
<== предыдущая страница | | | следующая страница ==> |
Implementation | | | Kolupaev V.E. |