zoukankan      html  css  js  c++  java
  • 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.

  • 相关阅读:
    Java自学第十天
    Java自学第九天
    Java自学第八天
    Java自学第七天
    Java自学第六天
    Java自学第五天
    Java自学第四天
    Java自学第三天
    Oracle11g RAC单节点重启
    PostgreSQL 日志处理
  • 原文地址:https://www.cnblogs.com/delphi2014/p/4062061.html
Copyright © 2011-2022 走看看