Aspect Ratio - Forum

Forum Navigation
You need to log in to create posts and topics.

Aspect Ratio

How can I keep the aspect ratio(height and width) of an object such that the (auto-size width and height of the page) be activated?

In the below attachment I have a circle and I want whenever I resize the browser's window the circle should keep its aspect ratio of height and width it means not change to the ellipse.

 

Uploaded files:
  • You need to login to have access to uploads.

@asmat, go to Project > Properties and uncheck all "Dynamic sizing" options.
Then go to Project > Events > start-up and add this code:

slScaleAppLetterBox 320 480

Note than you can also use other scale commands within the same plugin "PowerApp".

Hi, luishp

The above command does not give a good result for mobile apps. I have solved the above problem with use of vw and vh unit.

Why we can not use directly "vw" or "vh" units in the VisualNEO Web?

Uploaded files:
  • You need to login to have access to uploads.

Hi @asmat,

How exactly have you solved the problem?
There is also another possiblity for mobile apps only using something like this on
Project > Properties > Advanced > Custom metadata > Head

<meta id="testViewport" name="viewport" content="width=1280, user-scalable=no, maximum-scale=1">

Just change to "width=1280" for whatever works for your App.
I will take a look at the allowed units for next version.

By the way, the picture you have shared belongs to my solution or yours?
I think it's fine, just need to change the App background color.

Hi @luishp,

I have used the below command for solving the above problem:

SetObjectBounds "circle" "70vw" "5vh" "20vw" "20vw"

The picture belongs to your solution.