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