我正在尝试对使用 RectangleGeometry
制作的图像剪辑进行动画处理。
但是,我找不到任何解决方案。我已经得出以下结论:
- Windows Metro 不支持 RectAnimation(此问题的直接解决方案)
- Windows Metro doesn't support PathGeometry在剪辑中 ( so I could do a workaround )
- Windows Metro 没有
RectAnimationUsingKeyFrames
( another solution presented by Microsoft )
最佳答案
我最终在 RectangleGeometry
中添加了一个 Transform 并对其进行了动画处理:
<!-- In the Clip Section -->
<RectangleGeometry
x:Name="RectangleGeometry"
Rect="0,0,727,400" >
<RectangleGeometry.Transform>
<TranslateTransform x:Name="ClipTransform"/>
</RectangleGeometry.Transform>
</RectangleGeometry>
<!-- Animate the Clip Section -->
<Storyboard x:Name="Anim">
<DoubleAnimation
Duration="0:0:1"
To="-100"
Storyboard.TargetName="ClipTransform"
Storyboard.TargetProperty="Y" />
</Storyboard>
我不知道是否有更好的解决方案,但我找到了这个。
关于animation - 在 Windows 8/Metro/Store 中对 RectangleGeometry(在 Image.Clip 内)进行动画处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14139357/