请记住,这只是一个颠倒加载图像的快速修复方法。我认为在完成工作的同时,代码是尽可能简单的。
public static CGImage RotateImage (CGImage oImage)
{
CGContext oContext;
UIImage oRotatedImage;
RectangleF oImageBounds;
//
oImageBounds = new RectangleF (0, 0, oImage.Width, oImage.Height);
//
UIGraphics.BeginImageContext (oImageBounds.Size);
oContext = UIGraphics.GetCurrentContext ();
//
oContext.DrawImage (oImageBounds, oImage);
oRotatedImage = UIGraphics.GetImageFromCurrentImageContext ();
UIGraphics.EndImageContext ();
//
return oRotatedImage.CGImage;
}
我在玩中的代码时偶然发现了这个解决方案
this question
然后想,嘿,这很有效,我不需要它来做任何其他事情:D所以我希望这能帮助你!
此外,如果有人能解释这一切的原因,那么请,我很想知道到底发生了什么。我以前唯一使用2D图形的经验是使用XNA框架。