Created
January 26, 2011 16:48
-
-
Save jak/796985 to your computer and use it in GitHub Desktop.
Pictures over Web Services - Client side
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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