0

Please, tell me, how can I place the image inside in the middle? Stretch: Uniform to fill. I want to focus was on the middle of the picture

Stretch: Uniform to fill

Nikita
  • 154
  • 1
  • 13

3 Answers3

1

Why dont you Try setting your Image control set Stretch =Fill

<Image height="20" width="20" Stretch="Fill"/>
  • 1
    Most of the times, this is a bad idea, especially if the source does not have the same aspect ratio as the image control. – Ertay Shashko May 23 '14 at 23:48
0

If the aspect ratio of the image you want to put inside an Image control is not 1:1 and you set the aspect ratio of your Image control to 1:1 (e.g. Width="20" and Height="20" you will have a deformed image.

So, the best approach is, set the Width="20" but don't set the Height, let it calculate that automatically. Then, set Stretch="Uniform" (not uniform to fill). It should display the image correctly.

Hope this helps.

Ertay Shashko
  • 1,247
  • 2
  • 12
  • 21
0

You can wrap the image inside a Border and set the HorizontalAlignment and VerticalAlignment attributes of your image to 'Center'.

Minh Thai
  • 568
  • 6
  • 18