- Home /
How to download an image and stock it on the device in C# ?
Hi !
I know how to download an image from an URL and display it :
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class DownloadImage : MonoBehaviour {
public RawImage img;
IEnumerator Start () {
WWW www = new WWW("MyURL");
yield return www;
img.texture = www.texture;
img.SetNativeSize();
}
}
But I don't want to display it immediatly, I want to download all my images, and each time put it in the persistent data on the device and in the same movement rename it to give it an ID. I need some help to stock it, I tried with File.WriteAllBytes but It won't work on a RawImage.
I need some help, thank you for helping me !
http://answers.unity3d.com/questions/705516/downloading-images-and-text-files-from-server.html
Is this you are looking for??
I already try this and it doesn't work. I just want to download a picture, rename it and keep it in the device.
Your answer
Follow this Question
Related Questions
WWW file download size 0 Answers
Wait for file download 1 Answer
Download multiple textures 0 Answers
Download and save images into local phone storage makes the app hang 1 Answer
Problem using WWW to load text file. 0 Answers