赞
踩
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;
}
public String Texture2DToBase64(Texture2D t2d)
{
byte[] bytesArr = t2d.EncodeToJPG();
string strbaser64 = Convert.ToBase64String(bytesArr);
return strbaser64;
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。