I edit references and add System.Drawing in it!
Monodevelop have no problem!
But why unity3d have error:
Assets/showpicture.cs(6,14): error CS0234: The type or namespace name Drawing' does not exist in the namespace System’. Are you missing an assembly reference?
I have System.Drawing in the project’s references !Why?
Do unity3d not support this namespace ? And how to make a stream with picture to a texture or jpg by unity3d?
code:
WebResponse result=null;
WebRequest req=WebRequest.Create(url);
result=req.GetResponse();
Stream ReceiveStream=result.GetResponseStream();
ps:
url is a link for a picture!
question:
How to display ReceiveStream as a textrue?It’s I am trying to do !Please help me!Thanks!
I have used WWW class before asked this question!Your answer work well on any platform but phone access internet with GSM ISP’s proxy.Also our team want to use TCP to make game.WWW class use HTTP as I know.So I just want to know the converting between stream and object(Or resources like picture(jpg,mgp)).
Through the stream, if you will get some byte data. You could then use the Texture2D.LoadImage to retrieve the jpg or png data for use in the game.
If you had raw byte data, you could create a new Texture2D and set the information using Texture2D.SetPixels. All you would have to do is to convert the byte data to colors using the System.BitConverter class. Remember to apply the changes before using it.