【发布时间】:2018-11-09 15:28:21
【问题描述】:
我有一个大小为 30x30 的 png 图像。然后我使用我的 30x30 图像在按钮内创建了一个图像:
<Button>
<Image x:Name="Sample" Source="sample.png" Stretch="None" SnapsToDevicePixels="True"
Width="30" Height="30" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
但图像仍然在图像控件中显示得很大并被裁剪。为什么即使它们具有相同的大小也会发生这种情况?
【问题讨论】:
-
可能两张图片有不同的DPI resolutions?
-
看看this answer。