0

当我放大图像时,我在运行时收到此错误消息。

这是 XAML 代码

<Grid x:Name="LayoutRoot" Background="Transparent">
        <toolkit:GestureService.GestureListener>
            <toolkit:GestureListener 
                PinchStarted="OnPinchStarted"
                PinchDelta="OnPinchDelta"
                DragDelta="OnDragDelta"
                Flick="GestureListener_Flick">
            </toolkit:GestureListener>
        </toolkit:GestureService.GestureListener>
        <Image x:Name="ImgZoom" Source="Image.jpg" HorizontalAlignment="Left" Width="480" Height="770" Stretch="Fill"  Margin="0,0,0,0" VerticalAlignment="Top"/>
</Grid>

得到这个异常

4

1 回答 1

2

您需要在 xaml 中定义 RenderTransform

<Image x:Name="ImgZoom" Source="Image.jpg" HorizontalAlignment="Left" Width="480" Height="770" Stretch="Fill"  Margin="0,0,0,0" VerticalAlignment="Top">
    <Image.RenderTransform>
        <CompositeTransform/>
    </Image.RenderTransform>
</Image>
于 2013-10-18T17:09:11.903 回答