不知道这里有什么问题。如果我执行以下操作:
<Image Width="90" Height="97" Source="<some path>" />
我的图像按预期显示。但我想裁剪它,所以我使用下面的代码和完全相同的路径。
<Image>
<Image.Source>
<CroppedBitmap Source="<same path>">
<CroppedBitmap.SourceRect>
<Int32Rect X="0" Y="0" Width="100" Height="100" />
</CroppedBitmap.SourceRect>
</CroppedBitmap>
</Image.Source>
</Image>
什么都没有出现。谁能告诉我为什么它不起作用?如果这有所作为,我正在使用 PNG。