windows phone 8 中 BitmapImage 的 90/180/270 度旋转

90/180/270 deg rotation of BitmapImage in windows phone 8

我已经关注了 msdn link

但问题出在TrasformedBitmap。 错误说

The type or namespace name 'TransformedBitmap' could not be found

我不明白为什么会弹出这个错误,因为我已经包含了命名空间,即 System.Windows.Media.ImagingPresentationCore assembly 也在那里。

看起来已弃用 Transformed Bitmap 您现在可以尝试将 BitmapImage 设置为 Image 控件并使用

旋转该图像
MyImageControl.Source= new BitmapImage(new Uri("ms-appx:///Assets/SmallLogo.scale-240.png", UriKind.RelativeOrAbsolute));

RotateTransform myRotateTransform = new RotateTransform();
myRotateTransform.Angle=30;
MyImageControl.RenderTransform = myRotateTransform;