public HttpResponseMessage Get(string imageName, int width, int height) { Image img = GetImage(imageName, width, height); MemoryStream ms = new MemoryStream(); img.Save(ms, System.Drawing.Imaging.ImageFormat.Png); HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK); result.Content = new ByteArrayContent(ms.ToArray()); result.Content.Headers.ContentType = new MediaTypeHeaderValue("image/png"); return result; }