public object Any(HelloImage2 request) { using (Bitmap image = new Bitmap(10, 10)) { using (Graphics g = Graphics.FromImage(image)) { g.Clear(Color.Red); } using (MemoryStream m = new MemoryStream()) { image.Save(m, ImageFormat.Png); var imageData = m.ToArray(); //buffers return(new HttpResult(imageData, "image/png")); } } }
/// <summary>Anies the given request.</summary> /// /// <param name="request">The request.</param> /// /// <returns>An object.</returns> public object Any(HelloImage2 request) { using (Bitmap image = new Bitmap(10, 10)) { using (Graphics g = Graphics.FromImage(image)) { g.Clear(Color.Red); } using (MemoryStream m = new MemoryStream()) { image.Save(m, ImageFormat.Png); var imageData = m.ToArray(); //buffers return new HttpResult(imageData, "image/png"); } } }