Skip to content

Instantly share code, notes, and snippets.

@jak
Created January 26, 2011 16:48
Show Gist options
  • Save jak/796985 to your computer and use it in GitHub Desktop.
Save jak/796985 to your computer and use it in GitHub Desktop.
Pictures over Web Services - Client side
private void LoadImage() {
// Create web service
WebServiceSoapClient service = new WebServiceSoapClient();
// Fetch encoded image using the web service method
string encodedImage = service.GetPicture();
// turn the Base64 string back into bytes
byte[] buffer = Convert.FromBase64String(encodedImage);
// create a stream from the data
MemoryStream stream = new MemoryStream(buffer, false);
// recreate Image object, and display it in pictureBox1
Image img = Image.FromStream(stream);
pictureBox1.Image = img;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment