Advertisement
FrayxRulez

Flip and rotate

May 3rd, 2020
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.27 KB | None | 0 0
  1. switch (rotation)
  2. {
  3.     case BitmapRotation.Clockwise90Degrees:
  4.     case BitmapRotation.Clockwise270Degrees:
  5.         switch (next)
  6.         {
  7.             case BitmapFlip.None:
  8.                 next = BitmapFlip.Vertical;
  9.                 break;
  10.             case BitmapFlip.Vertical:
  11.                 next = BitmapFlip.None;
  12.                 break;
  13.             case BitmapFlip.Horizontal:
  14.                 next = BitmapFlip.None;
  15.                 rotation = rotation == BitmapRotation.Clockwise90Degrees
  16.                     ? BitmapRotation.Clockwise270Degrees
  17.                     : BitmapRotation.Clockwise90Degrees;
  18.                 break;
  19.         }
  20.         break;
  21.     case BitmapRotation.None:
  22.     case BitmapRotation.Clockwise180Degrees:
  23.         switch (next)
  24.         {
  25.             case BitmapFlip.None:
  26.                 next = BitmapFlip.Horizontal;
  27.                 break;
  28.             case BitmapFlip.Horizontal:
  29.                 next = BitmapFlip.None;
  30.                 break;
  31.             case BitmapFlip.Vertical:
  32.                 next = BitmapFlip.None;
  33.                 rotation = rotation == BitmapRotation.None
  34.                     ? BitmapRotation.Clockwise180Degrees
  35.                     : BitmapRotation.None;
  36.                 break;
  37.         }
  38.         break;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement