• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by lastyome · Feb 22, 2012 at 12:48 PM · texture2dimageopencvloadimage

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.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image zackivano · Apr 12, 2012 at 10:44 AM 0
Share

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?

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

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

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

import video from camera 3 Answers

Create, export, and then load a huge image. 2 Answers

Continuously scanning and recognising text with Unity3D on Android 0 Answers

How do I get file size of texture? 1 Answer

How to save Texture2D to BMP? 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges