16
votes

I have an image in a WPF window. When I resize the window the image resizes with it. Is it possible to preserve the aspect ratio when the image is resizing, so it doesn't look squashed if the window is too narrow? If so, how?

1
The default value for Image.Stretch is Uniform, so that would not be happening by default. That means you are specifically doing something to override it. And you don't show what it is you are doing.Jon
Can you show your XAML please?Mare Infinitus

1 Answers

29
votes

Set the Image.Stretch Property to Uniform

<Image Stretch="Uniform" ....etc />