Windows 8 用于windows 8.1的FlipBoard应用程序中的页面翻转动画
我想使页面翻转效果与相同 以前我尝试将Windows Phone的翻页动画移植到Winrt,但由于不支持PathGeometry剪辑,我放弃了同样的操作Windows 8 用于windows 8.1的FlipBoard应用程序中的页面翻转动画,windows-8,windows-runtime,winrt-xaml,Windows 8,Windows Runtime,Winrt Xaml,我想使页面翻转效果与相同 以前我尝试将Windows Phone的翻页动画移植到Winrt,但由于不支持PathGeometry剪辑,我放弃了同样的操作 我正在尝试一种在WinRT(XAML-C#)上工作的解决方案。因为我对直接x+C++没有太多的知识。 你可以使用 PrimePurtudio作为投影属性,并很容易地完成你需要的转换。使用“混合”(blend)进行变换,您应该会看到它是如何工作的。首先需要做的一件事是将UI拆分为两个曲面,然后可以使用RenderTargetBitmap.Ren
我正在尝试一种在WinRT(XAML-C#)上工作的解决方案。因为我对直接x+C++没有太多的知识。 你可以使用<代码> PrimePurtudio作为<代码>投影属性,并很容易地完成你需要的转换。使用“混合”(blend)进行变换,您应该会看到它是如何工作的。首先需要做的一件事是将UI拆分为两个曲面,然后可以使用
RenderTargetBitmap.Render()
方法-将所有要转换的内容呈现为一个位图,并将要转换的内容呈现为另一个位图,然后适当地组合位图。希望这有帮助:我已使用eventrigger加载事件
使用平面投影:
我使用的是RotationX,它围绕旋转的x轴旋转图像
<Grid >
<Grid.Triggers>
<EventTrigger>
<BeginStoryboard>
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationX)" Storyboard.TargetName="Flip1">
<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="90.0146"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="180"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationX)" Storyboard.TargetName="Flip2">
<EasingDoubleKeyFrame KeyTime="0" Value="-180"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="-90"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Flip1">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
<DiscreteObjectKeyFrame KeyTime="0:0:0.3">
<DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Flip2">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
<DiscreteObjectKeyFrame KeyTime="0:0:0.3">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Grid.Triggers>
<Rectangle x:Name="Flip1" Fill="Aqua" Height="50" Width="50">
<Rectangle.Projection>
<PlaneProjection x:Name="PlaneProjection1"></PlaneProjection>
</Rectangle.Projection>
</Rectangle>
<Rectangle x:Name="Flip2" Fill="Aqua" Height="50" Width="50">
<Rectangle.Projection>
<PlaneProjection x:Name="PlaneProjection2"></PlaneProjection>
</Rectangle.Projection>
</Rectangle>
</Grid>
看得见的
崩溃
看得见的
看得见的
使用ScaleTransform:将水平比例从1更改为-1具有相同的旋转效果,您可以设置ScaleX属性的动画以获得旋转效果。您还应该将其可见性从可见更改为隐藏,反之亦然。使图像在旋转90度后消失
<Rectangle x:Name="Flip3" Fill="Red" Height="50" RenderTransformOrigin="0.5,.5" Width="50">
<Rectangle.RenderTransform>
<ScaleTransform x:Name="st" ScaleX="1" ScaleY="0.1"></ScaleTransform>
</Rectangle.RenderTransform>
<Rectangle.Triggers>
<EventTrigger>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)" Storyboard.TargetName="Flip3" From="1" To="-1" Duration="0:0:0.5">
<DoubleAnimation.EasingFunction>
<ExponentialEase EasingMode="EaseOut"></ExponentialEase>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Rectangle.Triggers>
</Rectangle>
按照微软,不使用DirectX和C++就不可能在FrPoLoad场景中获得完美的帧速率。比如用鼠标拖动页面等等?