THPDFLoadedPageRenderSession Class
保留頁面渲染狀態與即時的部分點陣圖,讓已載入頁面可以拆成多次有界呼叫來渲染
宣告
THPDFLoadedPageRenderSession = class(TObject)
public
constructor Create(AOwner: THotPDF; PageIndex, DPI: Integer;
CancellationToken: THPDFCancellationToken);
constructor CreateRegion(AOwner: THotPDF; PageIndex: Integer;
RegionLeft, RegionBottom, RegionRight, RegionTop: Single;
DPI: Integer; CancellationToken: THPDFCancellationToken);
function ContinueRender(MaxMilliseconds: Cardinal = 0;
MaxObjects: Integer = 0): THPDFProgressiveRenderStatus;
function TakeBitmap: TBitmap;
function GetFallbackDiagnostics: THPDFRenderFallbackDiagnostics;
property Bitmap: TBitmap read GetBitmap;
property ObjectsProcessed: Integer read GetObjectsProcessed;
property TotalObjects: Integer read GetTotalObjects;
property ProgressiveJPEGScansDecoded: Integer
read GetProgressiveJPEGScansDecoded;
property ProgressiveJPEGImagesDecoded: Integer
read GetProgressiveJPEGImagesDecoded;
property Status: THPDFProgressiveRenderStatus read GetStatus;
property IsRegionRender: Boolean read FIsRegionRender;
property RegionLeft: Single read FRegionLeft;
property RegionBottom: Single read FRegionBottom;
property RegionRight: Single read FRegionRight;
property RegionTop: Single read FRegionTop;
property RegionVisiblePaintObjects: Integer
read GetRegionVisiblePaintObjects;
property RegionCulledPaintObjects: Integer
read GetRegionCulledPaintObjects;
property FallbackDroppedCount: Integer read GetFallbackDroppedCount;
property OnProgress: THPDFProgressiveRenderProgressEvent
read FOnProgress write SetOnProgress;
property OnProgressiveJPEGScan: THPDFProgressiveJPEGScanEvent
read FOnProgressiveJPEGScan write SetOnProgressiveJPEGScan;
end;
單元
HPDFDoc
狀態值
prsReady表示頁面已初始化,尚未執行任何內容運算元prsPaused表示預算在所有運算元完成前用盡prsCompleted表示完整頁面點陣圖已可用prsCancelled表示 callback 或權杖在運算元邊界停止了工作階段
使用說明
- 工作階段通常由
THotPDF.BeginLoadedPageProgressiveRender與BeginLoadedPageProgressiveRegionRender工廠方法建立,兩者會代表呼叫端呼叫Create或CreateRegion區域建構子 - 任一預算設為零代表該項工作不設限;兩者皆為零時,一次呼叫就會跑到終態
Bitmap仍由工作階段擁有,僅供唯讀預覽存取TakeBitmap只在終態有效,並把擁有權轉移給呼叫端ProgressiveJPEGScansDecoded與ProgressiveJPEGImagesDecoded統計成功的增量影像工作,OnProgressiveJPEGScan則可在可見掃描之後取消IsRegionRender識別 ROI 工作階段;區域屬性保留要求的使用者空間邊界,可見與剔除計數器描述顯示清單的繪製挑選FallbackDroppedCount計數在保留上限之後被丟棄的渲染 fallback 診斷,GetFallbackDiagnostics則傳回保留的 THPDFRenderFallbackDiagnostic 記錄,說明個別物件為何從原生渲染器退回- 每筆診斷都帶著 THPDFRenderFallbackKind 取值,已知時另帶運算子名稱與物件名稱,以及原因文字
- 已載入的
THotPDF實體與取消權杖必須存活到工作階段釋放為止