THotPDF.DecodeLoadedImageRegionAtResolution Method

یک مستطیل در مختصات مبدأ را decode می‌کند و به decoder اجازه می‌دهد سطح رزولوشن پایین‌تری را انتخاب کند که همچنان اندازهٔ خروجی درخواستی را برآورده کند

اعلان

function DecodeLoadedImageRegionAtResolution(
  AImageStream: THPDFStreamObject;
  RegionLeft, RegionTop, RegionRight, RegionBottom,
  TargetPixelWidth, TargetPixelHeight: Integer): TBitmap;

واحد

HPDFDoc

پارامترها

نامهدف
AImageStreamLoaded image XObject stream to decode
RegionLeftInclusive left source coordinate
RegionTopInclusive top source coordinate
RegionRightExclusive right source coordinate
RegionBottomExclusive bottom source coordinate
TargetPixelWidthMinimum useful decoded width before final rendering scale
TargetPixelHeightMinimum useful decoded height before final rendering scale

مقدار بازگشتی

برای ناحیهٔ clamp‌شدهٔ غیرخالی یک بیت‌مپ تازه‌تخصیص‌یافته برمی‌گرداند، یا وقتی تصویر یا هندسهٔ درخواستی قابل decode نباشد nil

Resolution selection

مثال

Preview := PDF.DecodeLoadedImageRegionAtResolution(
  ImageStream, 0, 0, SourceWidth, SourceHeight, 320, 200);
try
  Canvas.StretchDraw(TargetRect, Preview);
finally
  Preview.Free;
end;

APIهای مرتبط