2

不知道这里有什么问题。如果我执行以下操作:

<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。

4

1 回答 1

0

我有一个类似的问题,有一个gif。在 Visual Studio 2012 中,图像不会显示在设计视图中,但当我实际运行应用程序时,裁剪后的图像显示得很好。

于 2013-04-30T16:29:08.173 回答