这里是一个动画链接:http://www.microdivision.com/blog/Strange-Silverlight-Behavior为什么动画中的球在改变位置时会被切断?
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
x:Class="BouncingBall.MainPage"
Width="640" Height="480">
<UserControl.Resources>
<Storyboard x:Name="Bounce" RepeatBehavior="Forever" AutoReverse="True">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="Ball">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<SplineDoubleKeyFrame KeyTime="0:0:1" Value="-144" KeySpline="0,1,1,1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</UserControl.Resources>
<i:Interaction.Triggers>
<i:EventTrigger>
<ei:ControlStoryboardAction Storyboard="{StaticResource Bounce}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<Canvas x:Name="LayoutRoot" Background="#FFCADFFF">
<Ellipse x:Name="Ball" Stroke="Black" Width="100" Height="100" Fill="#FFF31D1D" Canvas.Top="190" Canvas.Left="0">
<Ellipse.RenderTransform>
<CompositeTransform/>
</Ellipse.RenderTransform>
</Ellipse>
</Canvas>
</UserControl>
它看起来完美的我。你遇到什么浏览器? – tster 2011-03-24 17:52:44
我尝试了不同的浏览器,如IE8,Chrome 10,Firefox。我还要求另一个人从他的电脑看这个页面,他也注意到了这一点。当球上下移动时,它会在顶部和底部看起来扁平。 – 2011-03-24 17:56:26
有趣的是,当我制作一个打印屏幕时,它会显示一个完整的球,也许它与屏幕刷新有关? – 2011-03-24 17:58:29