开发者

The image becomes larger when it is added to a WPF page?

开发者 https://www.devze.com 2023-04-08 06:46 出处:网络
I\'ve got an image with 400 * 400 pixels. Now, when I add it to the WPF page: <Image Source=\"Resources\\about.png\" Stretch=\"None\"/>

I've got an image with 400 * 400 pixels. Now, when I add it to the WPF page:

<Image Source="Resources\about.png" Stretch="None"/>

its size become larger:

The image becomes larger when it is added to a WPF page?

Any开发者_如何转开发 idea why this behavior happens?


Specify the width and height explicitly:

<Image Source="Resources\about.png" Width="400" Height="400" />

(Also, in your screenshot, it looks like HorizontalAlignment and VerticalAlignment are set to Stretch?)

0

精彩评论

暂无评论...
验证码 换一张
取 消