Click here to Skip to main content
16,016,345 members

Comments by Waqas Ahmed Ansari (Top 1 by date)

Waqas Ahmed Ansari 4-Apr-14 16:26pm View    
I want to show the converted image in Image Box. But I am not able to show an image in there. This is the code I am using;

Service1Client GetNameFromService = new Service1Client();
GetNameRequest NameRequest = new GetNameRequest();
NameRequest.username = e.Parameter.ToString();
GetNameResponse NameResponse = await GetNameFromService.GetNameAsync(NameRequest);
lblName.Text = NameResponse.GetNameResult.NAME;
byte[] IMG = NameResponse.GetNameResult.IMAGE;


var stream = new InMemoryRandomAccessStream();
await stream.WriteAsync(IMG.AsBuffer());
stream.Seek(0);

BitmapImage image = new BitmapImage();
image.SetSource(stream);
imgUser.Source = image;

ID = NameResponse.GetNameResult.id;

await GetNameFromService.CloseAsync();