- (UIImage *)fitImageSizeWith:(UIImage *)img
{
float destWith = 600.0;
float destHeight = 600.0;
CGSize itemSize = CGSizeMake(destWith, destHeight);
UIGraphicsBeginImageContext(itemSize);
CGRect imageRect = CGRectMake(0, 0, destWith + 1, destHeight);
[img drawInRect:imageRect];
UIImage *newImg = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImg;
}
转载请注明原文地址: https://ju.6miu.com/read-1303292.html