I get a string from server that save an image in Base64 string and i convert to Image like this:
byte imageBytes = Convert.FromBase64String(str); MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length); ms.Write(imageBytes, 0, imageBytes.Length); System.Drawing.Image img= System.Drawing.Image.FromStream(ms, true); // img does not contain a definition for 'texture'
then i want to set this ‘img’ to a Game Object Image runtime
and for this a need to get sprite of this img or create one sprite from img texture
but the problem is this ims is from using System.Drawing
and there is not texture or sprite and it should convert to type of UnityEngine.UI