you can call it converting bitmap to Texture2D too.
I am reading from a dll which has a image embedded in it , the image is a png but its type is bitmap ao i cant just say.
Unity does not support System.Drawing so anything related to System.Drawing seems to not work .
// how i read a image resource from my dll
//DaiM.Reality is the namespace
// fgl is a class
Assembly asm = typeof(DaiM.Reality.fgl).Assembly;
string resourcename = asm.GetName().Name + ".Properties.Resources";
ResourceManager rm = new ResourceManager(resourcename, asm);
// problem is here
Debug.Log(rm.GetObject("flag").GetType()); // will say bitmap
//so this wont work
Texture2D txtur = (Texture2D)rm.GetObject("flag"); // gives an error
↧