Rotate a UIImage by 90 degree angles
2014-07-13 15:07
330 查看
Rotate a UIImage by 90 degree angles
I was looking for an easy way to rotate an image by 90 degrees and all the methods I used lots of code & required redrawing the image, normally with a transform, then getting the image from that. All I wanted was to quickly and easily rotate a UIImage by 90degree angles so didn’t care about being able to precisely rotate by any angle.
UIImage *image = //... create an image image = [UIImage imageWithCGImage:image.CGImage scale:image.scale orientation:UIImageOrientationRight];
UIImageOrientationUp : 0°/360°
UIImageOrientationRight : 90°
UIImageOrientationLeft : 270°
UIImageOrientationDown : 190°
UIImageOrientation
Reference
A note though if you then rotate that image it’ll rotate relative to it’s current rotation. “image.imageOrientation”
相关文章推荐
- Q1.6 To rotate a image by 90 degress.
- 【7】Rotate matrix by 90 degrees
- [leetcode]Rotate Image, Matrix tranposition, matrix rotation 90 degree @ Python
- Roate image by 90 degree in place
- pdfrotate:rotates each page in a pdf file by a given angle(now support 90,180,270)
- Ch1.6: IN-place-ly rotate a pic(NxN matrix) by 90 digree in Verilog(CPP)
- Cocos2d-html5之RotateTo&RotateBy
- Rotate a vector by using quaternion
- 如何旋转rotate UIImage
- LeetCode-48-Rotate Image 矩阵旋转90
- Cocos2d-x 关于RotateBy在3D下的旋转不绕中心轴
- Download_Manager_for_Rapidshare_and_Megauploadby_7amada90
- Unity3D中使用ITween对模型进行自动旋转(RotateBy)
- cocos2d-x实例学习(3)之RotateTo&RotateBy
- Cocos2D-x游戏开发之七:CCMoveBy CCJumpBy CCRotateBy CCAction CCRepeatForever
- CCRotateBy 和 CCSkewBy 区别
- cocos2dx之CCRotateTo、CCRotateBy
- cocos2d之CCRotateTo、CCRotateBy
- cocos2d-x实例学习(6)之CCRotateTo和CCRotateBy实现变形
- iOS 8下UIImagePickerController弹出拍照界面后,镜头旋转了90°