+ (UIImage *)originImage:(UIImage *)image scaleToSize:(CGSize)size {
UIGraphicsBeginImageContextWithOptions(size, NO, [UIScreen mainScreen].scale);// size是想要设置成的大小
[image drawInRect:CGRectMake(0, 0, size.width, size.height)];
UIImage *scaleImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext(); return scaleImage;}
创建一个帮助类,添加上面的类方法即可获取满足大小要求的图片。