得到图片中的某一部分

UIImage *image = [UIImage imageNamed:filename];
CGImageRef imageRef = image.CGImage;

CGRect rect = CGRectMake(origin.x, origin.y ,size.width, size.height);

CGImageRef imageRefRect = CGImageCreateWithImageInRect(imageRef, rect);

UIImage *imageRect = [[UIImage alloc] initWithCGImage:imageRefRect];

posted @ 2012-05-04 23:14  高笑228  阅读(161)  评论(0编辑  收藏  举报