您可以将PNG保存到iOS5中的照片库中吗?



我注意到我正在制作的绘图应用程序中的线条图在使用此代码保存时质量非常低:

UIImage *imageToSave = drawImage.image;
UIImageWriteToSavedPhotosAlbum(imageToSave, nil, nil, nil);

据我所知,当使用UIImageWriteToSavedPhotosAlbum时,您无法设置JPG质量。

是否有一种方法可以直接将UIImage保存为PNG到照片库,或者有一种方法可以增加JPG质量?当做截图时(在iPad上按开/关+home键),抓取的图片质量是完美的,但我不能指望人们用这种方式保存图像。

任何帮助都非常感谢!

试试这个

NSData* pngdata = UIImagePNGRepresentation (drawImage.image); //PNG wrap 
UIImage* img = [UIImage imageWithData:pngdata];
UIImageWriteToSavedPhotosAlbum(img, nil, nil, nil);

最新更新