摘要:
Color 是画笔的基本属性, 比较有意思的是可以通过画刷来建立画笔.五种画刷都可以, 但使用实心画刷就没有意义了; 建立后, 通过画笔的 PenType 能知道是通过什么画刷建立的; 也能通过 Brush 属性获取回画刷.下面的例子只是测试了通过阴影画刷建立画笔:uses GdiPlus, GdiPlusHelpers;procedure TForm1.FormPaint(Sender: TOb... 阅读全文
摘要:
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton... 阅读全文
摘要:
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) ListBox1: TListBox; Button1: TButton; Button2: TButt... 阅读全文
摘要:
IGPPrivateFontCollection.AddFontFile: 从文件加载字体;IGPPrivateFontCollection.AddMemoryFont: 从内存加载字体AddFontFile 测试:uses GdiPlus;function GetFontsDirectory: string;var Len: Integer; buf: array[0..MAX_PATH-1... 阅读全文
摘要:
IGPFontFamily 的基本使用:uses GdiPlus, GdiPlusHelpers;procedure TForm1.FormPaint(Sender: TObject);const Pt: TGPPointF = (X:10; Y:10);var FontFamily: IGPFontFamily; Font: IGPFont; Brush: IGPSolidBrush;b... 阅读全文
摘要:
测试效果图:uses GdiPlus;procedure TForm1.FormPaint(Sender: TObject);var Graphics: IGPGraphics; Brush: IGPSolidBrush; Pt: TGPPointF; Font: IGPFont;begin Graphics := TGPGraphics.Create(Handle); Pt.Init... 阅读全文
摘要:
测试效果图:测试代码:uses GdiPlus, GdiPlusHelpers;procedure TForm1.FormPaint(Sender: TObject);const C1 = $FF000000; C2 = $FFFF0000; C3 = $FFFFFF00; C4 = $FFFF0000; C5 = $FF000000;var Brush: IGPPathGradien... 阅读全文
摘要:
测试效果图:测试代码:uses GdiPlus;procedure TForm1.FormPaint(Sender: TObject);var Graphics: IGPGraphics; Brush: IGPPathGradientBrush; Rect: TGPRect; Path: IGPGraphicsPath;begin Graphics := TGPGraphics.Crea... 阅读全文
摘要:
测试效果图:测试代码:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs;type TForm1 = class(TForm) procedure FormPaint(Sender: TObject); procedure For... 阅读全文
摘要:
最简单的 IGPPathGradientBrush 就是有一个中心颜色和一组周边颜色的渐变.这里牵扯到 CenterColor、SurroundColors 属性和 SetSurroundColors 方法.测试一效果图:测试一代码://使用 SetSurroundColors 方法设置周边色组:uses GdiPlus, GdiPlusHelpers;procedure TForm1.FormP... 阅读全文