unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
xpixel,ypixel,t: integer;
x,y: real;
begin
x := form1.ClientWidth / 2;
y := form1.ClientHeight / 2; //x,y获取窗体中心点
for t := 0 to 10000 do
begin
xpixel := round(cos(t/100) + t*sin(t/100)/100 + x);
ypixel := round(-sin(t/100) - t*cos(t/100)/100 +y);
canvas.Pixels[xpixel,ypixel] := clred; //坐标点设置为红色
end;
end;
end.