随笔分类 -  Delphi 与 GDI+

上一页 1 2 3 4 5 6 ··· 11 下一页
GdiPlus[42]: IGPGraphics (一)
摘要://方法IGPGraphics.DrawLine(); { 画线 }IGPGraphics.DrawLines(); { 画一组线 }IGPGraphics.DrawArc(); { 画弧线 }IGPGraphics.DrawBezier(); { 画 Bezier 线 }IGPGraphics.DrawBeziers(); { 画一组 Bezier 线 }IGPGraphics.DrawRect... 阅读全文
posted @ 2009-12-21 19:49 万一 阅读(6120) 评论(0) 推荐(1) 编辑
GdiPlus[41]: IGPRegion 区域
摘要:// 区域建立:TGPRegion.Create(); { 参数可以是矩形、路径、HRGN、区域数据, 或无参}TGPRegion.FromHRGN(); { 从 HRGN 初始化 }// 区域运算(矩形、路径、或另一个区域):IGPRegion.Intersect(); { 交集 }IGPRegion.Union(); { 并集 }IGPRegion.Exclude(); { 减去 }IGPRe... 阅读全文
posted @ 2009-12-21 12:00 万一 阅读(3274) 评论(3) 推荐(0) 编辑
GdiPlus[40]: 不该忽略的一些基础结构
摘要:这些基础结构有: TGPSize、TGPSizeF、TGPPoint、TGPPointF、TGPRect、TGPRectF.它们自身提供了一些方便的功能, 如果早看看的话前面的很多代码能更精简些.TGPPoint 或 TGPPointF 方便的功能:1、因为已经重载了 Add、Subtract 运算符, 所以 "点" 可以 + 或 -;2、可使用 Equals 函数对比是否一致.var Pt1,... 阅读全文
posted @ 2009-12-20 21:57 万一 阅读(2394) 评论(0) 推荐(1) 编辑
GdiPlus[39]: IGPGraphicsPath (六) - 路径的辅助工具 IGPGraphicsPathIterator
摘要:IGPGraphicsPathIterator 能遍历路径中的子路径和路径标记.IGPGraphicsPathIterator.Count; { 点总数 }IGPGraphicsPathIterator.SubpathCount; { 子路径数 }IGPGraphicsPathIterator.HasCurve; { 是否包含曲线 }IGPGraphicsPathIterator.Rewind; ... 阅读全文
posted @ 2009-12-19 22:42 万一 阅读(2511) 评论(2) 推荐(0) 编辑
GdiPlus[38]: IGPGraphicsPath (五) 路径标记
摘要:IGPGraphicsPath.SetMarker //建立一个标记IGPGraphicsPath.ClearMarkers //取消全部标记在路径中每建立一个图形都可以同时做个 Marker,真正使用这些个标记时, 主要通过 IGPGraphicsPathIterator 的 NextMarker() 方法.下面是建立并遍历 Marker 的演示代码, 暂未使用 IGPGraphicsPathI... 阅读全文
posted @ 2009-12-18 21:45 万一 阅读(2244) 评论(0) 推荐(0) 编辑
GdiPlus[37]: IGPGraphicsPath (四) 路径变换
摘要:IGPGraphicsPath.Flatten(); //把路径中的曲线转换为近似直线段(路径中只有 Bezier 线和直线).IGPGraphicsPath.Outline(); //同 Flatten();IGPGraphicsPath.Warp(); //四边形或平行四边形扭曲. IGPGraphicsPath.Widen(); //把轮廓转换为范围.IGPGraphicsPath.Tran... 阅读全文
posted @ 2009-12-17 20:46 万一 阅读(3604) 评论(0) 推荐(1) 编辑
GdiPlus[36]: IGPGraphicsPath (三) 路径中的数据
摘要:IGPGraphicsPath.PointCount; // 点总数IGPGraphicsPath.PathPoints; // 点数组, 浮点型IGPGraphicsPath.PathPointsI; // 点数组, 整型IGPGraphicsPath.PathTypes; // 点类型数组IGPGraphicsPath.PathData; // 点与点类型数据, IGPPathData 类型... 阅读全文
posted @ 2009-12-17 16:40 万一 阅读(2955) 评论(0) 推荐(0) 编辑
GdiPlus[35]: IGPGraphicsPath (二) 命中测试
摘要:IGPGraphicsPath.IsVisible //指定点是否在路径内IGPGraphicsPath.IsOutlineVisible //指定点是否在路径轮廓上本例测试图:本例代码:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dial... 阅读全文
posted @ 2009-12-17 14:21 万一 阅读(3045) 评论(0) 推荐(0) 编辑
GdiPlus[34]: IGPGraphicsPath (一)
摘要:路径是一组图形命令, 它能容纳所有基本图形和文本、子路径:IGPGraphicsPath.AddLine();IGPGraphicsPath.AddLines();IGPGraphicsPath.AddArc();IGPGraphicsPath.AddBezier();IGPGraphicsPath.AddBeziers();IGPGraphicsPath.AddCurve();IGPGraphi... 阅读全文
posted @ 2009-12-17 13:53 万一 阅读(3876) 评论(0) 推荐(0) 编辑
GdiPlus[33]: 基本绘图与填充命令
摘要:DrawLine();DrawLines();DrawArc();DrawBezier();DrawBeziers();DrawRectangle();DrawRectangles();DrawEllipse();DrawPie();DrawPolygon();DrawCurve();DrawClosedCurve();FillRectangle();FillRectangles();FillPo... 阅读全文
posted @ 2009-12-16 21:31 万一 阅读(7062) 评论(2) 推荐(0) 编辑
GdiPlus[32]: IGPPen: LineJoin、MiterLimit
摘要:LineJoin 测试效果图:LineJoin 测试代码:uses GdiPlus;procedure TForm1.FormPaint(Sender: TObject);const Pts: array[0..2] of TGPPoint = ((X:90;Y:80), (X:240;Y:30), (X:240;Y:80));var Graphics: IGPGraphics; Pen: ... 阅读全文
posted @ 2009-12-16 15:35 万一 阅读(2106) 评论(0) 推荐(0) 编辑
GdiPlus[31]: IGPPen: 自定义线帽
摘要:自定义线帽可以通过两个接口: IGPCustomLineCap、IGPAdjustableArrowCap.后者继承与前者, 专用于修改箭头线帽.IGPAdjustableArrowCap 测试效果图:IGPAdjustableArrowCap 测试代码:uses GdiPlus;procedure TForm1.FormPaint(Sender: TObject);var Graphics: ... 阅读全文
posted @ 2009-12-16 15:14 万一 阅读(2313) 评论(0) 推荐(0) 编辑
GdiPlus[30]: IGPPen: 线帽
摘要:StartCap 和 EndCap 属性分别用来读写两段的线帽, 测试图:StartCap 和 EndCap 测试代码:uses GdiPlus;procedure TForm1.FormPaint(Sender: TObject);const CapArr: array[0..8] of Byte = (0, 1, 2, 3, $10, $11, $12, $13, $14);var Gra... 阅读全文
posted @ 2009-12-16 12:21 万一 阅读(2283) 评论(0) 推荐(0) 编辑
GdiPlus[29]: IGPPen: 虚线样式
摘要:通过画笔的 DashStyle 属性可设置或读取虚线样式.通过 SetDashPattern 方法或 DashPattern 属性可自定义虚线样式.通过 DashPattern 属性还可以读出已有样式定义时的数组.自定义虚线样式样式时, 需要元素数是双数的数组数组, 元素值依次表示实线与空白的长度.通过 DashOffset 属性可设置虚线偏移.系统提供的虚线样式效果:自定义的两种样式效果:虚线偏... 阅读全文
posted @ 2009-12-16 00:56 万一 阅读(2962) 评论(0) 推荐(0) 编辑
GdiPlus[28]: IGPPen: 建立复合画笔
摘要:设置画笔的 CompoundArray 属性可得到复合画笔.它对应的类型是 IGPCompoundArray (IGPCompoundArray = IGPArray<Single).如果复合画笔是 X 条线, 则数组需要 2*X 个元素; 元素从外向里分别表示线的起点和终点的比例值.uses GdiPlus;procedure TForm1.FormPaint(Sender: TObje... 阅读全文
posted @ 2009-12-16 00:22 万一 阅读(1873) 评论(0) 推荐(0) 编辑
GdiPlus[27]: IGPPen: Alignment (画笔对齐)
摘要:uses GdiPlus;procedure TForm1.FormPaint(Sender: TObject);var Graphics: IGPGraphics; BlackPen, GreenPen: IGPPen; Rect: TGPRect;begin Rect.Initialize(20, 20, 80, 80); Graphics := TGPGraphics.Create... 阅读全文
posted @ 2009-12-16 00:00 万一 阅读(1587) 评论(0) 推荐(0) 编辑
GdiPlus[26]: IGPPen: 用画刷建立画笔
摘要:Color 是画笔的基本属性, 比较有意思的是可以通过画刷来建立画笔.五种画刷都可以, 但使用实心画刷就没有意义了; 建立后, 通过画笔的 PenType 能知道是通过什么画刷建立的; 也能通过 Brush 属性获取回画刷.下面的例子只是测试了通过阴影画刷建立画笔:uses GdiPlus, GdiPlusHelpers;procedure TForm1.FormPaint(Sender: TOb... 阅读全文
posted @ 2009-12-15 23:48 万一 阅读(2133) 评论(1) 推荐(0) 编辑
GdiPlus[25]: IGPInstalledFontCollection: 获取已安装的字体列表
摘要:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) ListBox1: TListBox; Button1: TButton; Button2: TButt... 阅读全文
posted @ 2009-12-15 16:41 万一 阅读(2050) 评论(5) 推荐(0) 编辑
GdiPlus[24]: IGPPrivateFontCollection: 分别从文件和内存加载字体
摘要:IGPPrivateFontCollection.AddFontFile: 从文件加载字体;IGPPrivateFontCollection.AddMemoryFont: 从内存加载字体AddFontFile 测试:uses GdiPlus;function GetFontsDirectory: string;var Len: Integer; buf: array[0..MAX_PATH-1... 阅读全文
posted @ 2009-12-15 16:34 万一 阅读(2921) 评论(0) 推荐(0) 编辑
GdiPlus[23]: IGPFontFamily
摘要:IGPFontFamily 的基本使用:uses GdiPlus, GdiPlusHelpers;procedure TForm1.FormPaint(Sender: TObject);const Pt: TGPPointF = (X:10; Y:10);var FontFamily: IGPFontFamily; Font: IGPFont; Brush: IGPSolidBrush;b... 阅读全文
posted @ 2009-12-15 16:17 万一 阅读(2824) 评论(1) 推荐(0) 编辑

上一页 1 2 3 4 5 6 ··· 11 下一页