//引入图片 UIImage *image = [UIImage imageNamed: @"sun0.jpg"]; //设置需要截取的大小 CGRect rect = CGRectMake(20, 50, 280, 200); //转换 CGImageRef imageRef =image.CGImage; //截取函数 CGImageRef imageRefs = CGImageCreateWithImageInRect( imageRef, rect ); //生成UIImage UIImage *newImage = [[UIImage alloc] initWithCGImage: imageRefs]; //添加到imageView中 imageView = [[UIImageView alloc] initWithImage: newImage]; //设置imageView的frame imageView.frame = rect;