赞
踩
//Base64ToTexture2D
public Texture2D Base64ToTexture2D(string Base64STR)
{
Texture2D pic = new Texture2D(190, 190, TextureFormat.RGBA32, false);
byte[] data = System.Convert.FromBase64String(Base64STR);
pic.LoadImage(data);
return pic;
}
//Texture2DToBase
public String Texture2DToBase64(Texture2D t2d)
{
byte[] bytesArr = t2d.EncodeToJPG();
string strbaser64 = Convert.ToBase64String(bytesArr);
return strbaser64;
}
好使
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。