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 IImageOptionsBuilder3

interface IImageOptionsBuilder3
Extends IImageOptionsBuilder2 This interface extends IImageOptionsBuilder2 to provide additional configuration options for region-based decoding for memory efficiency and capInsets of an IImage for nine-slice scaling.

Methods

decodeRegion()

void decodeRegion(com.amazon.kepler.uitoolkit.graphics.RectI region)
Specifies a rectangular region of the source image to decode enabling partial decoding of the specified region for memory efficiency. The region is defined in the source image’s coordinate space with (0,0) as the top-left corner. If not specified, the entire image will be decoded. Note :
  • When combined with preferred size option, the preferred size will be applied to the decoded region.
  • Aspect ratio mode options are maintained with respect to the decode region dimensions.
  • Each decode region of the image is independently cached. So querying the same region again should result in a cache hit.
  • If the specified region is invalid or extends beyond image bounds, the decoding operation will fail and trigger the IImageLoadListener::onFailure.

Parameters

region
com.amazon.kepler.uitoolkit.graphics.RectI — Required The region RectI to decode in source image

capInsets()

void capInsets(com.amazon.kepler.uitoolkit.graphics.RectI[] capInsets)
Specifies cap insets for nine-slice scaling of the image. Cap insets define non-scaling regions for nine-slice/nine-patch scaling. The areas between these regions will be stretched when the image is resized. Note :
  • Corner regions maintain their original size
  • Edge regions scale in one dimension
  • Center region scales in both dimensions
  • If cap inset regions overlap or extend outside image bounds, the decoding operation will fail and trigger the IImageLoadListener::onFailure.

Parameters

capInsets
com.amazon.kepler.uitoolkit.graphics.RectI[] — Required The cap inset regions in image
Last modified on October 29, 2026