THotPDF.DecodeLoadedImageStream Method
Decodes one loaded image XObject stream into a caller-owned TBitmap, including supported filter and color-space processing
Declaration
function DecodeLoadedImageStream(AImageStream: THPDFStreamObject): TBitmap;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
AImageStream | Loaded image XObject stream to inspect and decode |
Return value
Returns a newly allocated TBitmap on success or nil when the image format or geometry is unsupported
Usage notes
- The caller owns a non-nil returned bitmap and must free it
- Flate and LZW streams apply predictor geometry from
DecodeParmsorDP - LZW decoding honours
EarlyChangeand rejects invalid dictionary transitions instead of treating compressed bytes as pixels - TIFF Predictor 2 and PNG predictors 10 through 15 are supported for complete rows with valid image geometry
- Width, height, component count, bit depth, row size, and output size are checked before raster allocation
- Malformed Flate, LZW, or predictor data raises its decoding exception so callers can distinguish corruption from an unsupported image format
- Use
ExtractLoadedImagewhen selecting images by the index returned from loaded-image enumeration