1
我用下面的代码来旋转的UIImage旋转的UIImage并没有显示
double angle = -90;
NSData *imageData = [NSData dataWithContentsOfFile:sss];
UIImage *image =[UIImage imageWithData:imageData];
CGSize s = {image.size.width, image.size.height};
UIGraphicsBeginImageContext(s);
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(ctx, 0,image.size.height);
CGContextScaleCTM(ctx, 1.0, -1.0);
CGContextRotateCTM(ctx, 2*M_PI*angle/360);
CGContextDrawImage(ctx,CGRectMake(0,0,image.size.width, image.size.height),image.CGImage);
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[myUIImageView setImage:newImage];
,但没有显示在myUIImageView。
如果有什么问题?
欢迎任何评论
感谢
InterDev中
是的,我想绘制一个旋转的图像矩形,如何显示所有旋转的图像? – arachide 2010-12-13 08:30:13
我得到了解决方案!谢谢 – arachide 2010-12-13 09:35:01