THPDFJpegReducedDecoder
decode region JPEG ที่เข้ารหัสไว้ ลงสู่ bitmap BGR24 ความละเอียดต่ำที่แม่นยำโดยตรง
การประกาศ
function LoadFromBytes(const Data: THPDFJpegByteArray;
const Region: TRect; TargetWidth, TargetHeight: Integer;
MaxOutputBytes: Int64 = 268435456): Boolean;
function Decode: THPDFJpegReducedDecodeStatus;
การใช้งาน
Decoder := THPDFJpegReducedDecoder.Create;
try
if Decoder.LoadFromBytes(Data, Rect(0, 0, 12000, 12000), 300, 300) and
(Decoder.Decode = jrdsCompleted) then
begin
Bitmap.Assign(Decoder.Bitmap);
Info := Decoder.Info;
end;
finally
Decoder.Free;
end;
ความเป็นเจ้าของและขีดจำกัด
- decoder ทำสำเนา input ที่เข้ารหัสไว้ และเป็นเจ้าของ bitmap ที่เปิดผ่าน
Bitmap - bitmap ที่คืนค่ามาใช้ได้ต่อเนื่อง จนกว่า decoder จะถูกโหลดใหม่หรือถูกทำลาย
MaxOutputBytesจำกัดขนาด bitmap เป้าหมาย และค่าศูนย์จะปิดลิมิตที่ระบุชัดเจนนี้OnCancellationCheckถูกเรียกจากลูป scanlineInfoเปิดเรขาคณิตหลังสเกลที่ decoder รายงาน และค่าประมาณหน่วยความจำที่ใช้ทำงาน
API ที่เกี่ยวข้อง
THPDFJpegReducedDecodeInfo · THPDFJpegReducedDecodeStatus · การ decode JPEG แบบ Reduced-DCT