摘要:
使用 IDWriteTextLayout.Draw() 方法绘制文本主要是实现 IDWriteTextRenderer 接口。IDWriteTextRenderer 接口只能是手动实现,很灵活。unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Direct2D, D2D1;type TForm1 = class(TForm) procedure FormPaint(Sender: TObject); procedure Form 阅读全文
摘要:
使用 RenderTarget.DrawTextLayout() 方法主要是设置 IDWriteTextLayout 接口;构建 IDWriteTextLayout 接口需要 IDWriteTextFormat 接口。IDWriteTextLayout 接口是经过完全分析和格式化后的文本块。{RenderTarget.DrawTextLayout() 方法}procedure DrawTextLayout( origin: D2D1_POINT_2F; //起点 const textLayout: IDWriteTextLayout; //分析和格式化后的文本块 const defaultFo 阅读全文
摘要:
uses Direct2D, D2D1;{建立位图画刷的函数}function GetBitmapBrush(Canvas: TDirect2DCanvas; filePath: string): ID2D1BitmapBrush;var rBBP: TD2D1BitmapBrushProperties; bit: TBitmap;begin bit := TBitmap.Create; bit.LoadFromFile(filePath); rBBP.extendModeX := D2D1_EXTEND_MODE_WRAP; rBBP.extendModeY := D2D1_EXTEND_M 阅读全文