Delphi7 绘图(一)
绘图函数PolyGon,RoundRect,Ellipse。
PolyGon函数原型
procedure TCanvas.Polygon(const Points: array of TPoint);
功能:绘制多边形
参数:点的位置
RoundRect函数原型
功能:圆角矩形
procedure TCanvas.RoundRect(X1, Y1, X2, Y2, X3, Y3: Integer);
x1,y1矩形起始坐标
x2,y2矩形的终点坐标
y3 圆角的大小
Ellipse函数原型
功能:椭圆
procedure TCanvas.Ellipse(X1, Y1, X2, Y2: Integer);
x1,y1椭圆的左上角x坐标和y坐标
x2,y2椭圆的右下角x坐标和y坐标
unit Unit1; interface uses Windows, Messages, SysUtils, 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); begin Canvas.Pen.Color:=clBlue; //多边形 Canvas.PolyGon([Point(10,10),Point(30,10), Point(120,30),Point(230,120)]); //圆角矩形 Canvas.RoundRect(200,200,300,250,20,20); //圆形 Canvas.Ellipse(50,50,100,100); end; end.
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步