Interface IGraphicsModule3
interface IGraphicsModule3
Extends IGraphicsModule2
This interface extends IGraphicsModule2 to provide additional control over image decoding, including target size specification and region-based partial image decoding.
Methods
makeDecodedImageWithOptions()
Decodes an image with specified scaling and region options. Processing steps:IImage*makeDecodedImageWithOptions(u8[]encodedData,SizeItargetSize,ImageFilterQualityquality,boolkeepAspectRatio,RectI?decodeRegion)
- Decodes the source image or specified region
- Scales the decoded result to the target size
- JPEG
- PNG
- WebP
Parameters
encodedData
u8[] — Required
The encoded image data
targetSize
SizeI — Required
The desired target dimensions for the decoded image
quality
ImageFilterQuality — Required
The ImageFilterQuality to use during scaling
keepAspectRatio
bool — Required
If true, maintains aspect ratio using cover-fit scaling, otherwise, scales to exact dimensions
decodeRegion
RectI? — Optional
Optional region of the source image to decode
Returns
IImage*
A new image IImage containing the decoded and scaled result
Throws
InvalidArgumentError— for invalid inputs like:- Empty encoded data
- Target size width or height <= 0
- Unsupported image format
- Invalid decode region or decode region beyond image bounds

