Quantcast
Channel: Questions in topic: "dll"
Viewing all articles
Browse latest Browse all 706

How do I read a bitmap image and assign it to a Texture2D

$
0
0
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

Viewing all articles
Browse latest Browse all 706

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>