VCL 中的 Windows API 函数: BeginPath、EndPath
来源:互联网 发布:手机屏幕录像软件ios 编辑:程序博客网 时间:2024/05/16 11:25
BeginPath {路径开始}EndPath {路径结束}
StrokePath {绘制路径}
FillPath {填充路径}
StrokeAndFillPath {绘制并填充路径}
//在路径中可以使用的图形命令有:
AngleArc
Arc
ArcTo
Chord
CloseFigure
Ellipse
ExtTextOut
LineTo
MoveToEx
Pie
PolyBezier
PolyBezierTo
PolyDraw
Polygon
Polyline
PolylineTo
PolyPolygon
PolyPolyline
Rectangle
RoundRect
TextOut
代码文件:
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls;type TForm1 = class(TForm) RadioGroup1: TRadioGroup; procedure FormCreate(Sender: TObject); procedure FormPaint(Sender: TObject); procedure RadioGroup1Click(Sender: TObject); end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);begin RadioGroup1.Items.CommaText := '绘制路径,填充路径,绘制并填充'; RadioGroup1.ItemIndex := 0; RadioGroup1.Columns := RadioGroup1.Items.Count;end;procedure TForm1.FormPaint(Sender: TObject);begin Canvas.Font.Size := 36; Canvas.Font.Style := [fsBold]; SetBkMode(Canvas.Handle, TRANSPARENT); BeginPath(Canvas.Handle); Canvas.Rectangle(10,10,110,110); Canvas.TextOut(20,30,'Delphi 2007'); EndPath(Canvas.Handle); Canvas.Brush.Color := clYellow; Canvas.Pen.Color := clRed; case RadioGroup1.ItemIndex of 0: StrokePath(Canvas.Handle); 1: FillPath(Canvas.Handle); 2: StrokeAndFillPath(Canvas.Handle); end;end;procedure TForm1.RadioGroup1Click(Sender: TObject);begin Repaint;end;end.
窗体设计:
object Form1: TForm1 Left = 373 Top = 260 Caption = 'Form1' ClientHeight = 193 ClientWidth = 321 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Tahoma' Font.Style = [] OldCreateOrder = False Position = poDesigned OnCreate = FormCreate OnPaint = FormPaint PixelsPerInch = 96 TextHeight = 13 object RadioGroup1: TRadioGroup Left = 28 Top = 131 Width = 265 Height = 49 Caption = 'RadioGroup1' TabOrder = 0 OnClick = RadioGroup1Click endend
- VCL 中的 Windows API 函数: BeginPath、EndPath
- BeginPath&EndPath
- (转)BeginPath&EndPath
- BeginPath&EndPath&SelectClipPath
- BeginPath 和 EndPath的用法
- beginPath()和endPath()的介绍
- 从 VCL 中吸取营养-------VCL 中的 Windows API 函数(1): AbortDoc
- Varnish配置文件VCL中的函数详解
- 在Kylix中模拟Windows API中的FindWindow函数
- 在Kylix中模拟Windows API中的FindWindow函数
- windows API函数简介
- Windows API函数大全
- Windows API函数大全
- Windows API函数大全
- WINDOWS API 函数
- Windows API 函数大全
- Windows API函数大全
- Windows API函数大全
- 指针和句柄的区别
- 钉子
- 做一棵永远成长的苹果树
- 一个面向对象的OPENGL程序框架
- 动机的寓言:孩子在为谁而玩
- VCL 中的 Windows API 函数: BeginPath、EndPath
- 规划的寓言:把一张纸折叠51次
- Scripts for skeleton copy
- GIS大讨论(六):【转】金融风暴中的3S业界——冬天不寒冷
- TestDirector 8.2 SP2安装
- GNU Go开源象棋代码
- 逃避的寓言:小猫逃开影子的招数
- 打开TD提示:Error:Server is Not Available 的解决方法
- 常用 API 函数: 控件与消息函数