- Home /
Save Texture2D (Image) on Mobile (iOS)
Hello,
I have a system that dynamically generates and edits images taken from the mobile camera device. I want to be able to save this image within the app so the user can always load them back up later.
I DON'T mean to literally save the photo within the users photo library. I simply want to save the image within the app. I've been looking around and it seems way too complex just to be able to save some form of data.
The only method I can really see, is to convert the image into pixel data, and save it within a PlayerPrefs. There's got to be a simpler way then that, surely? I also tried using 'persistentDatapath' but that just comes up with access denied.
Thanks.
Not saving images, but this guy had the same error but fixed it, maybe it will help : link text
Answer by Paulius-Liekis · Feb 22, 2015 at 10:03 AM
See this one: http://docs.unity3d.com/ScriptReference/Texture2D.EncodeToPNG.html, i.e. EncodeToPNG and then File.WriteAllBytes to Application. persistentDataPath
Your answer
![](https://koobas.hobune.stream/wayback/20220613183935im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
how to set Image that converted from Base64 string to Sprite 1 Answer
Is there any way to save image in Unity Flash? 0 Answers
Conversion of float[] to byte[] is too slow, how to optimize this? 0 Answers
Is there a way to save a texture to the iPhone/iPad? 2 Answers
A good way to save an image in Unity webplayer and send it to a server? 2 Answers