|
Hello, I want to load in a Unity texture an image that I get from a dll, open with OpenCV. I actually just get the bytes array of an IplImage.imageData. This part works fine, and I can construct a new Texture2D using setPixels by reading the bytes array. However, i would like to use Texture2D.LoadImage for studying its performance, but I can't fine how to use it well. In every case, I get a red question mark on my texture. I try to just send my byte array to load image, and for tests, I also try to use TextAsset, load a jpeg file with extension ".txt", like in many examples I've seen, but I still get my question mark. What I would really like to know is what kind of data is expecting LoadImage. Thank you for your help.
(comments are locked)
|

I'm at the same point... I used SetPixels32 and then Apply() to load the IplImage, but is too much slow. With LoadImage I always got the red question mark. I tried to assign byte per byte a ready to use Color32 array into a byte array, but as always the Color32 array with SetPixels32 is working, not the clone byte array with LoadImage. Any suggestion on how to use it?