私は WPF を使用していますが、アニメーションを作成できません。
レンダリング変換の原点が 0,0 の x 度から回転する四角形があります。この四角形を y 度から回転させ、2 秒後に 0,1 からのレンダー変換原点を使用します。
もちろん、2番目のアニメーションの長方形の位置を維持したい.
私の問題は、rendertransform の原点を変更して 2 番目の回転を適用すると、現在の位置が保持されず、最初の位置から移動することです。
どうすればこれを達成できますか?
助けてくれてありがとう。
<Window x:Class="SimpleMove"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="OpenWWindow" Height="900" Width="900">
<Grid >
<Rectangle Name="rec1" Width="100" Height="400" Fill="DimGray" RenderTransformOrigin="0,0">
<Rectangle.RenderTransform>
<RotateTransform x:Name="Rec1_Rotate"/>
</Rectangle.RenderTransform>
</Rectangle>
<Button Width="45" Height="30" Name="Button1">Start
<Button.Triggers>
<EventTrigger RoutedEvent="Button.Click">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard TargetProperty="Angle">
<DoubleAnimation Storyboard.TargetName="Rec1_Rotate" By="40" Duration="00:00:1" BeginTime="00:00:00"/>
<PointAnimation Storyboard.TargetName="rec1" Storyboard.TargetProperty="RenderTransformOrigin" To="0,1" Duration="00:00:0" BeginTime="00:00:02" />
<DoubleAnimation Storyboard.TargetName="Rec1_Rotate" By="-80" Duration="00:00:2" BeginTime="00:00:03"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Button.Triggers>
</Button>
</Grid>
</Window>