Iphone 缩放图像并保存它们

Iphone 缩放图像并保存它们,iphone,uiimageview,uiimagepickercontroller,image-scaling,image-resizing,Iphone,Uiimageview,Uiimagepickercontroller,Image Scaling,Image Resizing,在我的应用程序中,用户可以通过相机拍摄图像或从相册中选择一张。 (我将相机拍摄的照片保存在相册中) 在这两种情况下,我都希望在documents目录中保存图像的缩放副本(640x920) 如何继续缩放并保存生成的图像?最简单的方法是使用 这是我的建议 一个使用它的基本例子 // #import <QuartzCore/QuartzCore.h> // #import "NYXImagesUtilities.h" //.. path is an NSString of the doc

在我的应用程序中,用户可以通过相机拍摄图像或从相册中选择一张。 (我将相机拍摄的照片保存在相册中)

在这两种情况下,我都希望在documents目录中保存图像的缩放副本(640x920)

如何继续缩放并保存生成的图像?

最简单的方法是使用

这是我的建议

一个使用它的基本例子

// #import <QuartzCore/QuartzCore.h> 
// #import "NYXImagesUtilities.h"
//.. path is an NSString of the documents directory + file name you want to save it to.
//.. myImage is the UIImage that you got from the user.

UIImage *scaledImage = [myImage scaleToFitSize:(CGSize){640, 920}];
[scaledImage saveToPath:path type:NYXImageTypePNG];
/#导入
//#导入“NYXImagesUtilities.h”
//.. path是要将其保存到的文档目录+文件名的NSString。
//.. myImage是您从用户处获得的UIImage。
UIImage*ScaleImage=[myImage scaleToFitSize:(CGSize){640920}];
[缩放图像保存路径:路径类型:NYXImageTypePNG];
最简单的方法是使用

这是我的建议

一个使用它的基本例子

// #import <QuartzCore/QuartzCore.h> 
// #import "NYXImagesUtilities.h"
//.. path is an NSString of the documents directory + file name you want to save it to.
//.. myImage is the UIImage that you got from the user.

UIImage *scaledImage = [myImage scaleToFitSize:(CGSize){640, 920}];
[scaledImage saveToPath:path type:NYXImageTypePNG];
/#导入
//#导入“NYXImagesUtilities.h”
//.. path是要将其保存到的文档目录+文件名的NSString。
//.. myImage是您从用户处获得的UIImage。
UIImage*ScaleImage=[myImage scaleToFitSize:(CGSize){640920}];
[缩放图像保存路径:路径类型:NYXImageTypePNG];