x


Using of Texture2D.LoadImage

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.

more ▼

asked Feb 22 '12 at 12:48 PM

lastyome gravatar image

lastyome
16 4 4 5

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?

Apr 12 '12 at 10:44 AM zackivano
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x354
x258
x25
x8

asked: Feb 22 '12 at 12:48 PM

Seen: 1433 times

Last Updated: Dec 10 '12 at 11:10 AM