从存储的png加载图像

时间:2023-01-24 14:57:09

How does one load or fetch an image that was saved to disk?

如何加载或获取保存到磁盘的图像?

I wrote the image to the documents filepath using NSData and a PNG representation. How does one get this image back? UIImage.

我使用NSData和PNG表示将图像写入文档文件路径。如何获得这张图片? UIImage的。

1 个解决方案

#1


7  

UIImage *theImage = [UIImage imageWithContentsOfFile:filePath];

As ever, see the UIImage documentation at Apple. It is your friend.

与以往一样,请参阅Apple的UIImage文档。这是你的朋友。

#1


7  

UIImage *theImage = [UIImage imageWithContentsOfFile:filePath];

As ever, see the UIImage documentation at Apple. It is your friend.

与以往一样,请参阅Apple的UIImage文档。这是你的朋友。