Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 WPF 窗口中有一个图像。当我调整窗口大小时,图像会随之调整大小。调整图像大小时是否可以保留纵横比,因此如果窗口太窄,它看起来不会被压扁?如果是这样,怎么做?
将Image.Stretch属性设置为Uniform
Image.Stretch
Uniform
<Image Stretch="Uniform" ....etc />