开发者

how to scale and get mirror image after rotating a UIImage?

my app has a photoshop like feature wherein the user can create a new image which is a combo of "n" number of images(sub imageS). the user can rotate, flip and zoom these sub images by selecting them one at a time. and in the end save the whole canvas as a image.

My problem is once the sub-image is rotated and then if i try to flip or zoom it, the subimage scale becomes very minute(of the order 0.0000076 etc) and the sub image is not visible. If i then zoom the sub image, after a certain amt of zoom it is then visible.

one more thing the above behavior is observed only if i rotate the subimage by 90 or 270 degree. if i rotate the sub image by either 180 or 360 then the image scale is intact and i am allowed to flip and zoom.

for all the 3 operation scale,zoom and rotate i am using "CGAffineTransformMakeScale" and "CGAffineTransformRotate". i know that the "transform" property that i use is not actually changing the image shape.

is there any better way to achieve my 3 functionalities?? or shud i keep track of the rotation and disable the flip n zoom button wen the rotation is eith开发者_运维百科er 90 or 270?

any help is appreciated:)


ok i got it... my mistake was using""CGAffineTransformMakeScale".

IF i change tat to "CGAffineTransformScale". it works like a gem.(allows me to use all 3 functionalities at any angle)

MakeScale was creatin new scale but now i am editing the existing scale, hence it works.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜