THotPDF.RegisterImageTilingPattern 方法
註冊一個彩色 PDF 平鋪 pattern,其 cell 會重複使用同一個既有影像 XObject,套用在多個各自裁剪的 affine 放置上
宣告
function RegisterImageTilingPattern(ImageIndex: Integer; BBoxLLx,
BBoxLLy, BBoxURx, BBoxURy: Single; XStep, YStep: Single;
const Placements: THPDFImageTilingPlacements;
TilingType: THPDFTilingPatternType;
const PatternMatrix: THPDFAffineMatrix): AnsiString; overload;
function RegisterImageTilingPattern(ImageIndex: Integer; BBoxLLx,
BBoxLLy, BBoxURx, BBoxURy: Single; XStep, YStep: Single;
const Placements: THPDFImageTilingPlacements;
TilingType: THPDFTilingPatternType;
const PatternMatrix: THPDFAffineMatrix;
UseImageSoftMask: boolean): AnsiString; overload;
單元
HPDFDoc
參數
ImageIndex選擇先前由AddImage或對等影像註冊 API 傳回的影像BBoxLLx、BBoxLLy、BBoxURx與BBoxURy定義有限正值的 pattern cell 邊界XStep與YStep定義有限非零的 cell 間距Placements提供 1 到 1024 個有限可逆矩陣,並各帶有限正值的裁剪矩形TilingType選擇 PDF 平鋪放置規則PatternMatrix把 pattern 座標映射到父內容串流的預設座標系統UseImageSoftMask重複使用所選影像的灰階/SMaskXObject 作為 cell 影像
行為
方法在 pattern dictionary 中只寫入一個影像 XObject 資源,每個放置都參照它,因此重複與鏡射的 cell 不會複製影像位元組
每個放置都以 q 與 Q 隔離,在串接矩陣之前先裁剪,並以與地區無關的 PDF 數值序列化
soft-mask overload 會以穩定的 SMIm 資源名稱連結一個既有 alpha 影像,讓重複與反射的 alpha cell 不必複製或解碼影像位元組
影像索引、放置數量、裁剪矩形、矩陣、邊界、間距或 pattern 矩陣不合法時,方法會擲出 ERangeError
傳回值
傳回供 THPDFPage.SetFillPattern 或 THPDFPage.SetStrokePattern 使用的穩定 pattern 資源名稱
相關 API
THPDFImageTilingPlacement · THotPDF.RegisterTilingPattern · THPDFPage.SetFillPattern