System.Windows.Forms.dll Download
Code
Public texture2d img = null; void Ongui () {if (GUI).
button (new Rect (0, 0, 100, 20), "Select File")) {OpenFileDialog od = new OpenFileDialog (); Od.
Title = "Please select Avatar picture"; Od.
MultiSelect = false; Od.
Filter = "Picture file (*.jpg,*.png,*.bmp) |*.jpg;*.png;*.bmp"; if (OD. ShowDialog () = = DialogResult.OK) {if (file.exists) (UnityEngine.Application.streamingAssetsPath + "/temp/temp.png")) {File.delete (UnityEngine.Application.streamingAssetsPath + "/te
Mp/temp.png "); File.Copy (OD.
FileName, UnityEngine.Application.streamingAssetsPath + "/temp/temp.png"); else {file.copy (od.
FileName, UnityEngine.Application.streamingAssetsPath + "/temp/temp.png"); } startcoroutine (GetTexture ("file://" +unityengine.application.streamingassetspath + "/Temp/temp.png"));
} if (img!= null) {GUI.
Drawtexture (New Rect (0, Img.width, img.height), IMG);
} IEnumerator gettexture (string url) {www www = new www (URL);
yield return www;
if (www.isDone && www.error = null) {img = www.texture;
Debug.Log (Img.width + "" + img.height); byte[] data = img.
Encodetopng ();
File.writeallbytes (UnityEngine.Application.streamingAssetsPath + "/temp/temp.png", data); }
}
Test discovery does not support BMP format Picture 2.25