ashish nirkhe
ashish nirkhe

Reputation: 697

How to Flip and Rotate image in C# Windows 8.1 Store App

I am trying to flip and rotate image in C# (for Windows Store App). And it becomes complicated if I try to flip image which is rotated first by some angle say x.

I see

Image.RotateFlip

method is available only in for Dektop apps.

Is there any existing API that can help in this situation? Any help appreciated :)

Upvotes: 3

Views: 3135

Answers (1)

Ashwin Krishnamurthy
Ashwin Krishnamurthy

Reputation: 3758

If you are working on a Windows Store App (in C#), I am assuming that you are using XAML for your GUI. If that is the case and you want to perform a rotation, This bit of markup should do it.

For Rotation :

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

For Flipping :

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

If you want to perform an animation, you might want to take a look at this answer.

Upvotes: 3

Related Questions