You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I want to decide which scaling rule is used in order to display the Image element. Depending on the scenario, the image element should preserve its aspect ratio and fit available width/height/space. There are also cases when the image should be scaled unproportionally.
Currently, the Image element changes its size according to provided rules:
It tries to fit the available space.
It always prevents its aspect ratio.
Describe the solution you'd like
Provide a flag to decide how the image is going to be scaled:
To fit the available width.
To fit the available height.
To fit the available space (both width and height = safest).
To cover provided area without preserving its aspect ratio (also safe but usually not desired).
Additional context
Important: this change needs to be properly documented. There are cases when a selected option may lead to infinite layouts. For example:
// Infinite layout example:.Width(400)// constrained size: width and height.Height(200).Image(data, ImageScaling.FitWidth);// image width aspect ratio 4x3// Example 2:.Row(row =>{ row.ConstantColumn(200).Height(300).Image(data, ImageScaling.FitHeight);// image width aspect ratio 4x3})
The text was updated successfully, but these errors were encountered:
MarcinZiabek
changed the title
The Image element should provide better control over its size
The AspectRatio element should provide better control over its size
Mar 26, 2021
MarcinZiabek
changed the title
The AspectRatio element should provide better control over its size
The Image element should provide better control over its size
Mar 26, 2021
How can I achieve image fit to contain. For example, I set container height to 100 and if image width bigger than height it scale height to fit and crop width or I set container width to 100 and image's height bigger than its width. The Image fit the width and crop height.
Is your feature request related to a problem? Please describe.
I want to decide which scaling rule is used in order to display the Image element. Depending on the scenario, the image element should preserve its aspect ratio and fit available width/height/space. There are also cases when the image should be scaled unproportionally.
Currently, the Image element changes its size according to provided rules:
Describe the solution you'd like
Provide a flag to decide how the image is going to be scaled:
Additional context
Important: this change needs to be properly documented. There are cases when a selected option may lead to infinite layouts. For example:
The text was updated successfully, but these errors were encountered: