Guest User

Untitled

a guest
Jul 21st, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. [WebMethod]
  2. public string GetPicture() {
  3. // Load the picture
  4. Image img = Image.FromFile("Path/To/Picture.jpg");
  5. // Create a memory stream, and put the image contents into it.
  6. MemoryStream stream = new MemoryStream();
  7. img.Save(stream, img.RawFormat);
  8. // return data, encoded in Base64
  9. return Convert.ToBase64String(stream.ToArray());
  10. }
Add Comment
Please, Sign In to add comment