GdiPlus[28]: IGPPen: 建立複合畫筆

設定畫筆的 CompoundArray 屬性可得到複合畫筆.它對應的類型是 IGPCompoundArray (IGPCompoundArray = IGPArray<Single>).如果複合畫筆是 X 條線, 則數組需要 2*X 個元素; 元素從外向裡分別表示線的起點和終點的比例值.uses GdiPlus;procedure TForm1.FormPaint(Sender: TObject);var Graphics: IGPGraphics; Pen: IGPPen;

GdiPlus[19]: IGPPathGradientBrush 之 SetCenterPoint

測試:測試代碼:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs;type TForm1 = class(TForm) procedure FormPaint(Sender: TObject); procedure FormMouseUp(Sender: TObject; Button: TMouseButton;

GdiPlus[37]: IGPGraphicsPath (四) 路徑變換

IGPGraphicsPath.Flatten(); //把路徑中的曲線轉換為近似直線段(路徑中只有 Bezier 線和直線).IGPGraphicsPath.Outline(); //同 Flatten();IGPGraphicsPath.Warp(); //四邊形或平行四邊形扭曲. IGPGraphicsPath.Widen(); //把輪廓轉換為範圍.IGPGraphicsPath.Transform(); //矩陣變換;

GdiPlus[29]: IGPPen: 虛線樣式

通過畫筆的 DashStyle 屬性可設定或讀取虛線樣式.通過 SetDashPattern 方法或 DashPattern 屬性可自訂虛線樣式.通過 DashPattern 屬性還可以讀出已有樣式定義時的數組.自訂虛線樣式樣式時, 需要元素數是雙數的數組數組, 元素值依次表示實線與空白的長度.通過 DashOffset 屬性可設定虛線位移.系統提供的虛線樣式效果:自訂的兩種樣式效果:虛線位移效果:測試系統提供的虛線樣式:uses GdiPlus;procedure

GdiPlus[20]: IGPPathGradientBrush 之 SetFocusScales

測試:測試代碼:uses GdiPlus;procedure TForm1.FormPaint(Sender: TObject);var Graphics: IGPGraphics; Brush: IGPPathGradientBrush; Rect: TGPRect; Path: IGPGraphicsPath;begin Graphics := TGPGraphics.Create(Handle); Rect.Initialize(10, 10, 180, 100);

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 Graphics: IGPGraphics; Pen: IGPPen; Pt1,Pt2:

GdiPlus[21]: IGPPathGradientBrush 之 InterpolationColors

測試:測試代碼:uses GdiPlus, GdiPlusHelpers;procedure TForm1.FormPaint(Sender: TObject);const C1 = $FF000000; C2 = $FFFF0000; C3 = $FFFFFF00; C4 = $FFFF0000; C5 = $FF000000;var Brush: IGPPathGradientBrush; Rect: TGPRect; Path: IGPGraphicsPath;

GdiPlus[31]: IGPPen: 自訂線帽

自訂線帽可以通過兩個介面: IGPCustomLineCap、IGPAdjustableArrowCap.後者繼承與前者, 專用於修改箭頭線帽.IGPAdjustableArrowCap 測試:IGPAdjustableArrowCap 測試代碼:uses GdiPlus;procedure TForm1.FormPaint(Sender: TObject);var Graphics: IGPGraphics; Pen: IGPPen; Cap1,Cap2:

GdiPlus[22]: IGPFont

測試:uses GdiPlus;procedure TForm1.FormPaint(Sender: TObject);var Graphics: IGPGraphics; Brush: IGPSolidBrush; Pt: TGPPointF; Font: IGPFont;begin Graphics := TGPGraphics.Create(Handle); Pt.Initialize(10, 10); Brush := TGPSolidBrush.Create($FFFF0

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: IGPPen;begin Graphics := TGPGraphics.Create(Handle);

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;begin FontFamily := TGPFontFamily.Create('微軟雅黑');

GdiPlus[24]: IGPPrivateFontCollection: 分別從檔案和記憶體載入字型

IGPPrivateFontCollection.AddFontFile: 從檔案載入字型;IGPPrivateFontCollection.AddMemoryFont: 從記憶體載入字型AddFontFile 測試:uses GdiPlus;function GetFontsDirectory: string;var Len: Integer; buf: array[0..MAX_PATH-1] of Char;begin GetWindowsDirectory(buf, Length(

GdiPlus[33]: 基本繪圖與填充命令

DrawLine();DrawLines();DrawArc();DrawBezier();DrawBeziers();DrawRectangle();DrawRectangles();DrawEllipse();DrawPie();DrawPolygon();DrawCurve();DrawClosedCurve();FillRectangle();FillRectangles();FillPolygon();FillEllipse();FillPie();FillClosedCurve();

GdiPlus[16]: IGPLinearGradientBrush 之 SetBlendBellShape、SetBlendTriangularShape

SetBlendBellShape 方法: 建立基於鐘形曲線的漸層過渡過程;SetBlendTriangularShape 方法: 建立一個從中心色向兩端單個顏色線性過渡的線性漸層過程.兩個方法好像區別不大.SetBlendBellShape 測試:SetBlendTriangularShape 測試:SetBlendBellShape 測試代碼:uses GdiPlus;procedure TForm1.FormPaint(Sender: TObject);var Graphics:

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: TButton; procedure Button1Click(Sender:

GdiPlus[34]: IGPGraphicsPath (一)

路徑是一組圖形命令,

GdiPlus[17]: IGPLinearGradientBrush 的其他方法和屬性

LinearColors //屬性; 擷取或設定漸層的起始色和結束色.Rectangle //屬性; 擷取定義漸層的起始點和終結點的矩形地區.WrapMode //屬性; 擷取或設定 WrapMode 枚舉, 指定畫刷環繞模式; 感覺它沒有存在的必要.TranslateTransform //方法; 平移.ScaleTransform //方法; 放縮.RotateTransform //方法; 旋轉.Transform //屬性;

GdiPlus[26]: IGPPen: 用畫刷建立畫筆

Color 是畫筆的基本屬性, 比較有意思的是可以通過畫刷來建立畫筆.五種畫刷都可以, 但使用實心畫刷就沒有意義了; 建立後, 通過畫筆的 PenType 能知道是通過什麼畫刷建立的; 也能通過 Brush 屬性擷取回畫刷.下面的例子只是測試了通過陰影畫刷建立畫筆:uses GdiPlus, GdiPlusHelpers;procedure TForm1.FormPaint(Sender: TObject);var Pen: IGPPen; Brush: IGPBrush;begin

GdiPlus[35]: IGPGraphicsPath (二) 點擊測試

IGPGraphicsPath.IsVisible //指定點是否在路徑內IGPGraphicsPath.IsOutlineVisible //指定點是否在路徑輪廓上本例測試圖:本例代碼:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs;type TForm1 = class(TForm)

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(Handle); BlackPen := TGPPen.Create($FF000000, 1.

總頁數: 61357 1 .... 4752 4753 4754 4755 4756 .... 61357 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.