【问题标题】:Rotate text in horizontal plane在水平面上旋转文本
【发布时间】:2013-07-07 13:56:03
【问题描述】:

这将像时钟一样旋转文本

    <DoubleAnimation Storyboard.TargetProperty="(TextBlock.RenderTransform).(RotateTransform.Angle)" 
    From="0" To="360" Duration="0:0:0.2" AutoReverse="True" RepeatBehavior="Forever"/>

如何在水平面上旋转文本(并看到背面的镜子)?
我还想围绕中点旋转,以便文本保持在 TextBlock 内。
这可以用 StoryBoard 完成吗?

【问题讨论】:

标签: .net wpf storyboard rendertransform


【解决方案1】:

不确定我是否正确地满足了您的要求,

但这就是你要找的吗?

如果是这样,您不需要我的评论中的链接。你可以选择:

<Storyboard x:Key="SomeStoryboard"
            AutoReverse="True"
            RepeatBehavior="Forever">
  <DoubleAnimationUsingKeyFrames Storyboard.TargetName="textBlock"
                                  Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
    <EasingDoubleKeyFrame KeyTime="0:0:1"
                          Value="-1" />
  </DoubleAnimationUsingKeyFrames>
</Storyboard>
...
<TextBlock x:Name="textBlock"
            HorizontalAlignment="Left"
            RenderTransformOrigin="0.5,0.5"
            Text="Some random text">
  <TextBlock.RenderTransform>
    <TransformGroup>
      <ScaleTransform />
      <SkewTransform />
      <RotateTransform />
      <TranslateTransform />
    </TransformGroup>
  </TextBlock.RenderTransform>
</TextBlock>

【讨论】:

    猜你喜欢
    • 2018-04-26
    • 1970-01-01
    • 1970-01-01
    • 2019-02-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多