Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

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()

IImage* makeDecodedImageWithOptions(u8[] encodedData, SizeI targetSize, ImageFilterQuality quality, bool keepAspectRatio, RectI? decodeRegion)
Decodes an image with specified scaling and region options. Processing steps:
  1. Decodes the source image or specified region
  2. Scales the decoded result to the target size
Supported formats:
  • JPEG
  • PNG
  • WebP
When keepAspectRatio is true, uses the maximum scale ratio between width and height to preserve image proportions.

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

Last modified on October 29, 2026