主题:请帮忙看一看
我的代码报错是drawing为声明 请问该如何修改
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
var
a:System.Drawing.Graphics;
mypen:System.Drawing.Pen;
mypoints:array[0..20] of system.drawing.PointF;
i:integer;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
for i:=0 to 9 do begin
mypoints[i].X:=10*i;
mypoints[i].Y:=i*i*3;
end;
for i:=10 to 20 do begin
mypoints[i].X:=10*i;
mypoints[i].Y:=(200+i*i)/15;
end;
a:=Picturebox1.CrreatGraphics;
a.clear(Picturebox1.BackColor);
a.DrawCurve(mypen,mypoints);
a.Dispose();
mypen.Dispose();
end;
end.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
var
a:System.Drawing.Graphics;
mypen:System.Drawing.Pen;
mypoints:array[0..20] of system.drawing.PointF;
i:integer;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
for i:=0 to 9 do begin
mypoints[i].X:=10*i;
mypoints[i].Y:=i*i*3;
end;
for i:=10 to 20 do begin
mypoints[i].X:=10*i;
mypoints[i].Y:=(200+i*i)/15;
end;
a:=Picturebox1.CrreatGraphics;
a.clear(Picturebox1.BackColor);
a.DrawCurve(mypen,mypoints);
a.Dispose();
mypen.Dispose();
end;
end.