Hi guys !
So my problem is I got this link http://viss.gonct.info/viss/res/images/banner/nplay/Chia-se-Nplay-Detail.png
Then I use www to download from this link and save into file.
WWW w = new WWW (url);
yield return w;
if (string.IsNullOrEmpty (w.error)) { // No Error
if(!isForceDownload){
try{
fl.WriteAllBytes( Application.persistentDataPath + "/" + name + ext , w.texture.EncodeToPNG() );
}catch(IOException e){
GameService.Log(e.StackTrace);
GameService.Log(e.Message);
}catch(System.Exception e){
GameService.Log (e.StackTrace);
GameService.Log (e.Message);
}
}
Texture2D tex = new Texture2D (1, 1);
w.LoadImageIntoTexture(tex);
callback (tex);
} else {
GameService.Log("Error downloading : " + url );
GameService.Log("Error message : " + w.error);
}
Then I also create Sprite from this Texture
ImageDownloader.GetImage(arg1._data.image_large,delegate(Texture obj) {
_large.sprite = Sprite.Create( obj as Texture2D,
new Rect( 0 , 0 ,obj.width , obj.height),
new Vector2(0.5f, 0.5f),
100,
0,
SpriteMeshType.FullRect);
And my downloaded texture look like this
So what happen to me ? Am I make something wrong here ?
Thanks.