canvas教程

Delphi7 绘图(一)

字号+ 作者:H5之家 来源:H5之家 2017-01-31 14:01 我要评论( )

Delphi7 绘图(一), 绘图函数PolyGon,RoundRect,Ellipse。 PolyGon函数原型procedure TCanvas.Polygon(const Points: array of TPoint);功能:绘制多边形参数:

正文

    绘图函数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); ; var Form1: TForm1; 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.



 

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

相关文章
  • HTML5 canvas 在线画笔绘图工具(四)

    HTML5 canvas 在线画笔绘图工具(四)

    2017-01-30 09:04

  • Delphi编程实现3D图形修饰技术

    Delphi编程实现3D图形修饰技术

    2017-01-22 08:00

  • UIKit与Quartz 2D绘图技术概要(swift)

    UIKit与Quartz 2D绘图技术概要(swift)

    2017-01-21 18:04

  • HTML5 学习总结(四)canvas绘图 WebGL SVG

    HTML5 学习总结(四)canvas绘图 WebGL SVG

    2017-01-21 08:02

网友点评
e