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

Struct ScalingMode

sealed struct ScalingMode
Defines Aspect ratio behavior of buffers while being presented on screen using MediaSurface.

Fields

Constants

PRESERVE

ScalingMode = {1}
Shows buffer with the same dimensions.

FIT_TO_DST_RECT

ScalingMode = {2}
Scales buffer to match size of the window.

SCALED

ScalingMode = {3}
Scales buffer based on the target rect.

FIT_TO_DST_RECT_ASPECT_RATIO

ScalingMode = {4}
Scales buffer to the window size while keeping aspect ratio & center position. Source buffer will not be cropped.

NONE

ScalingMode = {5}
Not specified.

BEST_FILL

ScalingMode = {6}
The buffer size is scaled to a rectangle as large as possible without showing any outside of buffer, keep aspect and center position.

STRETCH_DST_RECT_ASPECT_RATIO

ScalingMode = {7}
Scales buffer to fit in window, initially without cropping. Scaling up beyond the bounds of the window will stretch the dst rect and excess is cropped down to window bounds. Aspect ratio and center position are maintained.
Last modified on October 29, 2026