Windows phone 7 如何翻转文本块
如何翻转已经旋转到90度的文本块 “旋转”与“翻转”不同。希望你能帮助下面的代码 RotateTransform transform = new RotateTransform(); transform.Angle = 90.0; txtBlock.RenderTransform = transform; from here, I want to flip RotateTransform transform=新的RotateTransform(); 变换角度=90.0; txtBlock.RenderTransform=变换; 从这里开始,我想翻一翻 您可能可以使用,例如:Windows phone 7 如何翻转文本块,windows-phone-7,Windows Phone 7,如何翻转已经旋转到90度的文本块 “旋转”与“翻转”不同。希望你能帮助下面的代码 RotateTransform transform = new RotateTransform(); transform.Angle = 90.0; txtBlock.RenderTransform = transform; from here, I want to flip RotateTransform transform=新的RotateTransform(); 变换角度=90.0; txtBl
var scaleTransform = new ScaleTransform() { ScaleX = -1 };
根据需要,您可以使用ScaleX和ScaleY更改ScaleX以切换轴。如果需要平滑翻转动画,您可以使用附加的
ScaleTransform
,然后设置此变换的动画
<Storyboard x:Key="Storyboard_Flip">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
Storyboard.TargetName="front"
Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
<SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="0" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.2"
Storyboard.TargetName="back"
Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
<SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="Storyboard_Reverse">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
Storyboard.TargetName="back"
Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
<SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="0" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.2"
Storyboard.TargetName="front"
Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
<SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
这是反向翻转动画
<Storyboard x:Key="Storyboard_Flip">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
Storyboard.TargetName="front"
Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
<SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="0" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.2"
Storyboard.TargetName="back"
Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
<SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="Storyboard_Reverse">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
Storyboard.TargetName="back"
Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
<SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="0" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00.2"
Storyboard.TargetName="front"
Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)">
<SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
如果您需要xaml中的某些内容,请尝试以下方法:
<TextBlock Height="45" HorizontalAlignment="Left" Margin="41,137,0,0" Name="textBlock1" Text="This is sample text" VerticalAlignment="Top" Width="296" RenderTransformOrigin="0.5,0.5" >
<TextBlock.RenderTransform>
<CompositeTransform ScaleX="-1"/>
</TextBlock.RenderTransform>
</TextBlock>
y方向翻转需要您设置复合变换ScaleY=“-1”
您所说的“翻转”是什么意思?你能提供一个你想要达到的目标的例子(例如屏幕模型)吗?