Hi, I am really confused how to load System.Drawing.Image using MemoryStream in Unity. My code is working in Unity Editor only but I can't get system image from Windows build
here is my code,
using UnityEngine;
using System.Drawing;
public Image byteArrayToImage(byte[] byteArrayIn)
{
MemoryStream ms = new MemoryStream(byteArrayIn);
Image returnImage = Image.FromStream(ms);
return returnImage;
}
I want to print image from this code i have attached the printer and i got image in editor but when I build in windows, I get an error with Object reference not set to instance of an object for an issue of MemoryStream. Any help will be appreciated.