Is it possible to determine a Texture or Texture2D image type? Ie, is it JPG, PNG, GIF, BMP?
I am aware there is the property Texture2D.format but this gives me RGB24. The reason why I need to know if because I need to convert the image to a Byte array so I can store the image in a SQLite3 database.
public byte[] toByteArray(Texture t) {
Image img = somehow convert a texture to a Image //Image.FromFile(@"C:\Lenna.jpg");
byte[] arr;
using (MemoryStream ms = new MemoryStream())
{
img.Save(ms, t.type); //System.Drawing.Imaging.ImageFormat.Jpeg);
arr = ms.ToArray();
}
return arr;
}
http://docs.unity3d.com/Documentation/ScriptReference/Texture2D-format.html http://docs.unity3d.com/Documentation/ScriptReference/TextureFormat.html no PNG option or such just raw data
– Fornoreason1000SOLVED! Looks like problem was with calling PlayGamesPlatform.Activate(); AFTER logging in. That line must be before logging in.
– Leonid