คลาส THPDFLoadedPageRenderSession
เก็บสถานะการ render ของหน้าเพจและ bitmap บางส่วนที่ยังใช้งานได้ต่อเนื่อง เพื่อให้ render หน้าเพจที่โหลดไว้ได้หลายรอบ โดยแต่ละรอบมีขอบเขตจำกัด
การประกาศ
THPDFLoadedPageRenderSession = class(TObject)
public
function ContinueRender(MaxMilliseconds: Cardinal = 0;
MaxObjects: Integer = 0): THPDFProgressiveRenderStatus;
function TakeBitmap: TBitmap;
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 OnProgress: THPDFProgressiveRenderProgressEvent
read FOnProgress write SetOnProgress;
property OnProgressiveJPEGScan: THPDFProgressiveJPEGScanEvent
read FOnProgressiveJPEGScan write SetOnProgressiveJPEGScan;
end;
ยูนิต
HPDFDoc
ค่าสถานะ
prsReadyหมายถึงหน้าเพจถูก initialize แล้วและยังไม่มี content operator ใดทำงานprsPausedหมายถึงงบประมาณหมดก่อนที่ operator จะทำครบprsCompletedหมายถึง bitmap ทั้งหน้าเพจพร้อมใช้แล้วprsCancelledหมายถึง callback หรือ token สั่งหยุดเซสชันที่ขอบเขตของ operator
หมายเหตุการใช้งาน
- งบประมาณตัวใดตัวหนึ่งตั้งเป็นศูนย์เพื่อไม่จำกัดงานได้ ส่วนถ้าเป็นศูนย์ทั้งคู่จะวิ่งจนถึงสถานะสุดท้ายภายในการเรียกเดียว
Bitmapยังเป็นของเซสชันและมีไว้สำหรับเข้าถึงเพื่อ preview แบบอ่านอย่างเดียวTakeBitmapใช้ได้เฉพาะในสถานะสุดท้าย และจะโอนความเป็นเจ้าของให้ผู้เรียกProgressiveJPEGScansDecodedและProgressiveJPEGImagesDecodedนับงานรูปภาพแบบ incremental ที่สำเร็จ ส่วนOnProgressiveJPEGScanยกเลิกต่อได้หลังจาก scan ที่มองเห็นได้หนึ่งชุดIsRegionRenderระบุเซสชันแบบ ROI โดย property กลุ่ม region เก็บขอบเขต user space ที่ขอมาไว้ และตัวนับ visible กับ culled อธิบายการคัดเลือก paint จาก display list- instance
THotPDFที่โหลดไว้และ cancellation token ต้องยังมีชีวิตอยู่ จนกว่าเซสชันจะถูกปล่อย