Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [WebMethod]
- public string GetPicture() {
- // Load the picture
- Image img = Image.FromFile("Path/To/Picture.jpg");
- // Create a memory stream, and put the image contents into it.
- MemoryStream stream = new MemoryStream();
- img.Save(stream, img.RawFormat);
- // return data, encoded in Base64
- return Convert.ToBase64String(stream.ToArray());
- }
Add Comment
Please, Sign In to add comment