Scalability Menu


Aspect Ratio

Sometimes you want the application to be shown in a specific aspect ratio, regardless of the screen size.

As images are scaled in different devices, they are resized based on the container size. The images have specific properties that define the area to be shown when resized.

For example, the following table illustrates what happens to the parts marked with yellow rectangles in the following figures, when scaling properties are applied.

To set the required aspect ratio, use the evas_object_size_hint_aspect_set() function or the aspect_preference attribute in the EDC.
Image resizing effects with a specific aspect ratio
Aspect Container area
720×384 (15:8)720×640 (9:8)
HORIZONTAL
Resizing based on the container width while keeping the image aspect ratio.
Extra height goes outside the image area and is clipped.
VERTICAL
Resizing based on the container area while keeping the image aspect ratio.
No extra width or height goes outside the image area, so the entire image is always shown.
BOTH
Resizing based on the container area while keeping the image aspect ratio.
No extra width or height goes outside the image area, so the entire image is always shown.
NONE
Resizing to fill the available area while keeping the image aspect ratio.
Extra width or height goes outside the image area and is clipped.

Setting the Image Aspect Ratio

In case of an image object, you can set its aspect ratio with additional APIs:

Image resizing without keeping the aspect ratio
Container area
720×384 (15:8) 720×640 (9:8)

Scalability Menu