Computer Magic Logo
Fit and fill

Monday, May 2, 2016

Published by Aristotelis Pitaridis

The aspect property of the image control allows us to define the size mode that the image control will use in order to display the image. We can use one of the following values for the aspect property.

  • AspectFit — the default
  • Fill — stretches without preserving the aspect ratio
  • AspectFill — preserves the aspect ratio but crops the image
<Image x:Name="MyImage" Source="http://www.domain.com/image.png" Aspect="AspectFill" />