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.

posted @ 2014-10-30 10:58  Delphi爱好者2014  阅读(1027)  评论(0编辑  收藏  举报