- Home /
PHP Image to C# 2D Texture
Hey guys, having a little issue here.
I'm building an android app that will be loading in a news feed, and I need to have a 2D Texture and text for each news listing. I'm getting the data for the feed with PHP, but I can't find a way to send an image to Unity, and transform it with C# into a 2D Texture. I've found absolutely nothing about this on the answers board, and don't have any code whatsoever to get this started. I'm more or less looking for an idea on where to start.
What do you guys think I should be doing?
I'm unclear about your stumbling block here. You can use the WWW class to download any image you want. It comes into Unity as a Texture2D, no conversion necessary.
Our PHP system uses PHP's GD Image interface to generate and send images. I need to take a GD Image object and send it to Unity, and then convert it to a 2D Texture. Should I be printing the GD Image object to the page, and then using www.texture?
Answer by Kamuiyshirou · May 01, 2014 at 05:06 PM
A similar solution:: https://www.youtube.com/watch?v=RqoM3H2lFHE
We have solutions for everything, so we resorted to at least a similar way.
Unfortunately, this is sending the image in the opposite direction. I'm sending images from the webserver to Unity, not the other way around.
Answer by xortrox · May 02, 2014 at 08:29 AM
You could possibly convert the image into hex values separated by comma (so that you get just text) and then parse the text in unity, this would probably only be a good solution if you don't depend on a lot of these images every second.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
C# - Read JSON 1 Answer
Upload an image onto the database from Unity 1 Answer
Storing Player Sessions 0 Answers