AddModernImageFromString

Image handling, Modern image codecs, Memory input

Description

Adds AVIF, HEIF, HEIC, or JPEG XL binary data held in an AnsiString

Syntax

Function TPDFlib.AddModernImageFromString(
  Const Source: AnsiString;
  Options: Integer= 8): Integer;

Parameters

SourceComplete binary source image
OptionsPNG-compatible import mode, defaulting to 8 for image, alpha, ICC, and high-bit-depth retention

Return values

Returns the new ImageID or 0 for empty, unsupported, or undecodable data

Remarks

The method copies the source into a seekable memory stream and otherwise uses the same path as AddModernImageFromStream

See also

AddModernImageFromFile, AddModernImageFromStream, ModernImageCodecAvailable