我有一個應用程序,我裁剪從camera.all拍攝的圖像很好。但裁剪後的圖像似乎模糊和拉伸。修剪圖像後圖像模糊?
CGRect rect = CGRectMake(20,40,280,200);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
// translated rectangle for drawing sub image
CGRect drawRect = CGRectMake(-rect.origin.x, -rect.origin.y,280,200);
// clip to the bounds of the image context
// not strictly necessary as it will get clipped anyway?
CGContextClipToRect(context, CGRectMake(0, 0, rect.size.width, rect.size.height));
// draw image
[image drawInRect:drawRect];
// grab image
UIImage* croppedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
CGSize size = [croppedImage size];
NSLog(@" = %@",NSStringFromCGSize(size));
NSData* pictureData = UIImagePNGRepresentation(croppedImage);
有人可以幫我找出我要去哪裏嗎?
你的意思是這個http://stackoverflow.com/questions/14645158/image-is-getting-拉伸和模糊後作物或此http://stackoverflow.com/questions/12109519/uiimage-showing-blur-after-cropping-in-iphone? – Joetjah 2013-04-09 14:40:47
你能提供一個截圖嗎? – Undo 2013-04-09 14:43:27
請檢查此:-http://stackoverflow.com/questions/15288092/how-to-crop-the-captured-image-before-saving-it-in-gallery-in-ios/15288173#15288173 – 2013-04-10 06:42:20