发布网友 发布时间:2022-08-23 14:52
共2个回答
热心网友 时间:2024-11-30 17:41
看看这个是不是你想要的:-(UIImage *)getImageFromImage{//大图bigImage//定义myImageRect,截图的区域CGRect myImageRect = CGRectMake(10.0, 10.0, 57.0, 57.0);UIImage* bigImage= [UIImage imageNamed:@"k00030.jpg"];CGImageRef imageRef = bigImage.CGImage;CGImageRef subImageRef = CGImageCreateWithImageInRect(imageRef, myImageRect);CGSize size;size.width = 57.0;size.height = 57.0;UIGraphicsBeginImageContext(size);CGContextRef context = UIGraphicsGetCurrentContext();CGContextDrawImage(context, myImageRect, subImageRef);UIImage* smallImage = [UIImage imageWithCGImage:subImageRef];UIGraphicsEndImageContext();return smallImage;}热心网友 时间:2024-11-30 17:42
截图之后,可以在visio中加坐标