How to control crop in C # or XAML when using UniformToFill with image

I have an image control in a editable window with a stretch property set to UniformToFill.

<Image Name="some_image" Stretch="UniformToFill" Margin="0,0,0,0" />

The clipping window is tied to the upper left edge of the image; resizing reduces the image to the right and bottom.

I want the image to be cropped equally on all sides. Am I tight and don’t notice the obvious solution?

How can I control how the image is cropped?

(Unrelated: this is my first stackoverflow post. I just wanted to start talking, thanks, this site was an amazing resource for me)

+3
source share
1 answer

HorizontalAlignment VerticalAlignment .

 <Image Name="some_image" Stretch="UniformToFill" Margin="0,0,0,0" HorizontalAlignment="Center" VerticalAlignment="Center" />

, !

+6

Source: https://habr.com/ru/post/1712743/


All Articles