- Home /
Save file from Resources folder to local directory
The problem is we want to save jpg image files in Resources to mobile local directory: Application.persistentDataPath.
If it's png, we could load into Texture2D then use EncodeToPNG. But it's jpg, we couldn't do that.
And we don't want to make the jpg file end with .bytes to be able to load as binary.
Thanks for the help in advance.
Answer by chris_taylor · Mar 01, 2014 at 06:09 AM
EncodeToPng should world no matter if it started as a jpg. It will return bytes then you can do System.IO.File.WriteAllBytes("Path/Filename.png", bytesFromEncodeToPng), if you still want to get a jpg ill be posting that in a min just need to look something up real quick
Update:
Link to possible jpg exporter
Your answer
Follow this Question
Related Questions
Find All Objects in Resource Folder at Runtime without Resource.LoadAll 4 Answers
Some small questions regarding files and directories. 0 Answers
How to create Sprite programmatically 1 Answer
Image Background Problem 1 Answer
how do you correctly copy a jpg file from streaming assets folder using www? 1 Answer