My C# class:

 public class Result
{
    public List<int> logo { get; set; }
}

public class RootObject
{
    public List<Result> Result { get; set; }
}

And My Wcf Service which contain image name as "logo".

{"Result":[{"logo":[255,216,255,224,0,16,74,70,73,...]}]}

How to change this "logo" byte array and display image in image control.

share|improve this question
I have seen this same question today - is this from the same user? – codingbiz Jan 7 at 13:05
yes i can't get answer so i posted again – Narasi Jan 7 at 13:08
what do you mean "I can't answer"? What was wrong with previous questions and the answers you received? – codingbiz Jan 7 at 13:09
sorry my question in my web service contain image in byte array format how i convert that byte array to image in image control asp.net c#. – Narasi Jan 7 at 13:13
Was the byte array created from an Image ? – prthrokz Jan 7 at 13:14
show 3 more comments

closed as not a real question by casperOne Jan 7 at 13:18

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

2 Answers

Can you try something like this :

MemoryStream ms = new MemoryStream(theByteArray);
Image image = Image.FromStream(ms);
share|improve this answer
it throw a error parameter is invalid.. – Narasi Jan 7 at 13:18
theByteArray should be the byte array you receive from web service – prthrokz Jan 7 at 13:18
i surfed lot of web sites and i can't get single solution till now.. – Narasi Jan 7 at 13:18
What format is the image stored as in the database? It may be for example PNG, JPEG or just pixel values. The parameter is invalid usually means that there is something wrong with the bytes (maybe a null value?) or that you need to specify the format which the byte array contains. – mortb Jan 7 at 13:23
1  
@mortb I was trying to get to this point in my comments, if at the service the Image would have been saved using the Save() method which takes the file format as well to a stream, if that is the stream being returned, then my method should work. Unfortunately, the question is not explained clearly enough :) – prthrokz Jan 7 at 13:26

I don't know of a way to do it in client JavaScript. The way it's typically done in the ASP.NET world is the server receives the image from the web service, takes the byte array and converts it into a file, writes the file to disk, or stream it to the client (if using a handler or MVC action), and then link to the physical file.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.