EncodeImageToJPXStream

Image handling

Description

Decodes a bitmap stream and writes a JPEG 2000 image in a standard JP2 container

Syntax

Function TPDFlib.EncodeImageToJPXStream(InStream, OutStream: TStream; Quality, Lossless: Integer): Integer;

Parameters

InStreamSource bitmap stream whose position is restored before return
OutStreamDestination stream replaced with the JP2 payload
QualityLossy quality from 1 to 100
Lossless1 selects reversible lossless encoding and 0 selects lossy encoding

Return values

Returns 1 on success or 0 for unsupported input, invalid options or encoding failure

Remarks

The VCL path accepts native bitmap streams and image formats exposed through installed GDI+ codecs, while NOVCL builds return 0 because the bundled encoder consumes a VCL bitmap

See also

EncodeImageToJPXFile, AddImageJPXFromStream