OfficeRasterImageDecoder
OfficeIMO.Drawing
Shared dependency-free decoder for raster image bytes that can be painted by OfficeRasterCanvas.
Inheritance
- object
- OfficeRasterImageDecoder
Remarks
HEIC composition converts supported ICC/SDR nclx source colors through the licensed system-codec path. Other decoding produces channel values, not a color-managed sRGB conversion. Embedded ICC profiles and PNG gamma/chromaticity metadata are validated as container metadata but are not applied to pixels. Normalize other color-managed source images before decoding when matching a managed display or print pipeline is required.
Methods
public static OfficeRasterImage Decode(byte[] bytes, OfficeRasterDecodeOptions? options = null) #Decodes the requested static frame, throwing InvalidDataException for unsupported input, rejection, or limits.
Parameters
- bytes byte[]
- options OfficeIMO.Drawing.OfficeRasterDecodeOptions? = null
Returns
OfficeRasterImagepublic static OfficeRasterImage Decode(byte[] bytes, OfficeRasterDecodeOptions? options, out OfficeRasterDecodeInfo info) #Decodes the requested static frame and returns source, loss, and orientation evidence.
Parameters
- bytes byte[]
- options OfficeIMO.Drawing.OfficeRasterDecodeOptions?
- info OfficeIMO.Drawing.OfficeRasterDecodeInfo
Returns
OfficeRasterImagepublic static OfficeRasterImage Decode(Stream stream, OfficeRasterDecodeOptions? options = null) #Decodes a static frame from a stream, leaving it open and restoring its position when seekable.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Drawing.OfficeRasterDecodeOptions? = null
Returns
OfficeRasterImagepublic static OfficeRasterImage Decode(Stream stream, OfficeRasterDecodeOptions? options, out OfficeRasterDecodeInfo info) #Decodes a static frame from a stream with source, loss, and orientation evidence.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Drawing.OfficeRasterDecodeOptions?
- info OfficeIMO.Drawing.OfficeRasterDecodeInfo
Returns
OfficeRasterImagepublic static OfficeRasterFrames DecodeFrames(byte[] bytes, OfficeRasterDecodeOptions? options = null, int maximumFrames = 256) #Decodes every rendered frame or independent page within aggregate limits; cancellation propagates.
Parameters
- bytes byte[]
- options OfficeIMO.Drawing.OfficeRasterDecodeOptions? = null
- maximumFrames int = 256
Returns
OfficeRasterFramespublic static OfficeRasterFrames DecodeFrames(byte[] bytes, OfficeRasterDecodeOptions? options, out OfficeRasterDecodeInfo info, int maximumFrames = 256) #Decodes every frame or page and retains source descriptors and complete-sequence evidence.
Parameters
- bytes byte[]
- options OfficeIMO.Drawing.OfficeRasterDecodeOptions?
- info OfficeIMO.Drawing.OfficeRasterDecodeInfo
- maximumFrames int = 256
Returns
OfficeRasterFramespublic static OfficeRasterFrames DecodeFrames(Stream stream, OfficeRasterDecodeOptions? options = null, int maximumFrames = 256) #Decodes every frame or page from a stream, leaving it open and restoring its position when seekable.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Drawing.OfficeRasterDecodeOptions? = null
- maximumFrames int = 256
Returns
OfficeRasterFramespublic static OfficeRasterFrames DecodeFrames(Stream stream, OfficeRasterDecodeOptions? options, out OfficeRasterDecodeInfo info, int maximumFrames = 256) #Decodes every stream frame or page with complete-sequence and source evidence.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Drawing.OfficeRasterDecodeOptions?
- info OfficeIMO.Drawing.OfficeRasterDecodeInfo
- maximumFrames int = 256
Returns
OfficeRasterFramespublic static byte[] ReadEncodedBytes(Stream stream, OfficeRasterDecodeOptions? options = null) #Reads owned encoded bytes within the shared raster size and working-memory limits.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Drawing.OfficeRasterDecodeOptions? = null
Returns
byte[]Exceptions
InvalidDataException– The input is empty, incomplete, or exceeds the configured limits.
public static bool TryDecode(byte[]? bytes, out OfficeRasterImage? image) #Attempts to decode image bytes into an RGBA raster buffer supported by dependency-free export.
Parameters
- bytes byte[]?
- image OfficeIMO.Drawing.OfficeRasterImage?
Returns
boolpublic static bool TryDecode(Stream stream, out OfficeRasterImage? image) #Attempts to decode a bounded raster stream and leaves a seekable stream at its original position.
Parameters
- stream System.IO.Stream
- image OfficeIMO.Drawing.OfficeRasterImage?
Returns
boolpublic static bool TryDecode(Stream stream, OfficeRasterDecodeOptions? options, out OfficeRasterImage? image, out OfficeRasterDecodeInfo info) #Attempts to decode a bounded raster stream using explicit selection, loss, resource, and cancellation policy.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Drawing.OfficeRasterDecodeOptions?
- image OfficeIMO.Drawing.OfficeRasterImage?
- info OfficeIMO.Drawing.OfficeRasterDecodeInfo
Returns
boolpublic static bool TryDecode(byte[]? bytes, OfficeRasterDecodeOptions? options, out OfficeRasterImage? image, out OfficeRasterDecodeInfo info) #Attempts to decode image bytes using explicit frame and animation-loss policy.
Parameters
- bytes byte[]?
- options OfficeIMO.Drawing.OfficeRasterDecodeOptions?
- image OfficeIMO.Drawing.OfficeRasterImage?
- info OfficeIMO.Drawing.OfficeRasterDecodeInfo
Returns
boolpublic static bool TryDecodeFrames(Stream stream, OfficeRasterDecodeOptions? options, out OfficeRasterFrames? frames, out OfficeRasterDecodeInfo info, int maximumFrames = 256) #Decodes every stream frame or page within limits, retaining failure evidence and preserving seekable position.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Drawing.OfficeRasterDecodeOptions?
- frames OfficeIMO.Drawing.OfficeRasterFrames?
- info OfficeIMO.Drawing.OfficeRasterDecodeInfo
- maximumFrames int = 256
Returns
boolpublic static bool TryDecodeFrames(byte[]? bytes, OfficeRasterDecodeOptions? options, out OfficeRasterFrames? frames, int maximumFrames = 256) #Attempts to decode every image, rendered animation frame, or page into independent managed buffers.
Parameters
- bytes byte[]?
- Encoded raster container.
- options OfficeIMO.Drawing.OfficeRasterDecodeOptions?
- Decode policy. MaximumDecodedPixels limits the entire decoded sequence.
- frames OfficeIMO.Drawing.OfficeRasterFrames?
- Complete decoded sequence on success, otherwise null.
- maximumFrames int = 256
- Maximum frame or page count, from one to 4096; the default is 256.
Returns
boolpublic static bool TryDecodeFrames(byte[]? bytes, OfficeRasterDecodeOptions? options, out OfficeRasterFrames? frames, out OfficeRasterDecodeInfo info, int maximumFrames = 256) #Decodes a complete bounded sequence and retains detected format, source descriptors, and failure evidence.
Parameters
- bytes byte[]?
- options OfficeIMO.Drawing.OfficeRasterDecodeOptions?
- frames OfficeIMO.Drawing.OfficeRasterFrames?
- info OfficeIMO.Drawing.OfficeRasterDecodeInfo
- maximumFrames int = 256
Returns
boolInherited Methods
Fields
public const string SupportedFormatDescription #Human-readable summary of raster formats currently decoded by the managed renderer.
PNG and APNG frames, JPEG, bounded classic TIFF pages, unsigned eight/sixteen-bit and finite fixed/floating-point gray/RGB JPEG XR, uncompressed BMP, explicitly selected GIF frames, lossless VP8L WebP, lossy VP8 WebP image bytes with optional raw or compressed alpha, bounded 8/10-bit YUV420 or monochrome AVIF still items with optional straight alpha, bounded PNG/DIB icon entries, portable bitmap/graymap/pixmap, and the managed TGA subset