本實例要在窗體上直接繪制正弦曲線
procedure TForm
var
x: Integer;
y
begin
Canvas
Canvas
for x :=
begin
a := (x/self
y := Sin(a);
y := (
Canvas
end;
end;
程序首先設置了窗體的Canvas對象中畫筆的寬度
程序代碼如下
unit Unit
interface
uses
Windows
Dialogs
type
TForm
procedure FormPaint(Sender: TObject);
procedure FormResize(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form
implementation
{$R *
procedure TForm
var
x: Integer;
y
begin
Canvas
Canvas
for x :=
begin
a := (x/self
y := Sin(a);
y := (
Canvas
end;
end;
procedure TForm
begin
Refresh;
end;
procedure TForm
begin
self
//防止圖形閃爍
end;
end
保存文件
圖
通過本程序的學習
From:http://tw.wingwit.com/Article/program/Delphi/201311/24751.html