【问题标题】:How to Flip and Rotate image in C# Windows 8.1 Store App如何在 C# Windows 8.1 Store App 中翻转和旋转图像
【发布时间】:2013-10-11 23:06:42
【问题描述】:

我正在尝试在 C# 中翻转和旋转图像(适用于 Windows Store App)。 如果我尝试翻转首先旋转某个角度的图像,例如 x,它会变得复杂。

我明白了

Image.RotateFlip

该方法仅适用于 Dektop 应用程序。

是否有任何现有的 API 可以在这种情况下提供帮助?任何帮助表示赞赏:)

【问题讨论】:

  • 使用 CompositeTransform 和情节提要来为旋转设置动画。

标签: c# windows-runtime windows-8.1


【解决方案1】:

如果您正在开发 Windows 应用商店应用程序(使用 C#),我假设您使用 XAML 作为您的 GUI。如果是这种情况,并且您想要执行旋转,那么这个标记应该可以做到。

对于旋转:

 <Image Source="/Assets/Logo.png" >
        <Image.RenderTransform>
            <RotateTransform Angle="90"/>
        </Image.RenderTransform>
 </Image>

对于翻转:

<Image Source="/Assets/Logo.png">
  <Image.RenderTransform>
    <ScaleTransform ScaleY="-1"/>
  </Image.RenderTransform>
</Image>

如果你想执行动画,你可能想看看this的答案。

【讨论】:

  • 感谢 Ashwin 的快速响应。你能提供一些关于翻转图像的想法吗?我需要结合这两种效果。旋转我通常使用 Manipulation Delta 处理但我现在需要翻转预先旋转的图像(即水平翻转或垂直翻转 - 一种镜像效果)
猜你喜欢
  • 2015-07-20
  • 1970-01-01
  • 2014-04-03
  • 2022-09-27
  • 2017-06-05
  • 2019-04-03
  • 2011-04-29
  • 1970-01-01
  • 2014-12-09
相关资源
最近更新 更多