这是正对着键盘拍的,画面翻转了90°,怎样可以想竖屏时正常显示?
ringa_lee
You can take a look at the documentation about UIImage imageOrientation property. There are also many codes for correcting orientation on the Internet.
Like this
UIImage* image=[info objectForKey:UIImagePickerControllerOriginalImage]; UIImageOrientation imageOrientation=image.imageOrientation; if(imageOrientation!=UIImageOrientationUp) { // 原始图片可以根据照相时的角度来显示,但UIImage无法判定,于是出现获取的图片会向左转90度的现象。 // 以下为调整图片角度的部分 UIGraphicsBeginImageContext(image.size); [image drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)]; image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); // 调整图片角度完毕 }
Owner, has this problem been solved? ? ? Looking for answers
You can take a look at the documentation about UIImage imageOrientation property. There are also many codes for correcting orientation on the Internet.
Like this
Owner, has this problem been solved? ? ? Looking for answers