IHPDFDecodedBitmapHandle Interface

Provides immutable reference-counted access to decoded image storage shared by the loaded-image cache, singleflight waiters, and renderers

Declaration

IHPDFDecodedBitmapHandle = interface
  function GetWidth: Integer;
  function GetHeight: Integer;
  function GetPixelFormat: TPixelFormat;
  function GetByteSize: Int64;
  function CreateBitmapCopy: TBitmap;
  procedure StretchDraw(DestinationDC: HDC;
    const Destination: TRect; StretchMode: Integer);
end;

Ownership

The interface keeps decoded storage alive independently of cache eviction, cache invalidation, and document destruction

Reference counting is thread-safe and the shared mutable TBitmap is never exposed to callers

Drawing and copies

StretchDraw draws from the immutable shared storage without materialising a caller-owned bitmap and serialises access to the underlying GDI resource

CreateBitmapCopy returns an isolated TBitmap owned by the caller for APIs that need mutable pixels

Related APIs

THotPDF.AcquireLoadedImageStream · THotPDF.AcquireLoadedImageRegionAtResolution · Sharded Loaded-Image Decode Cache