objective-c之裁剪UIImage


UIImage *image = [UIImage imageNamed:@"..."];


CGImageRef imageRef = CGImageCreateWithImageInRect(image.CGImage, CGRectMake(x, y, w, h));


//获取裁剪后的图片

getImage = [UIImage imageWithCGImage:imageRef];


你可能感兴趣的:(ios,Objective-C)