public HttpResponseMessage Get()
{
Image img = GetImage();
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/jpg");
result.Content.Headers.ContentDisposition =
new ContentDispositionHeaderValue("Inline") { FileName = "123.jpg" };
return result;
}
private Image GetImage()
{
Image image = Bitmap.FromFile("E:\\123.jpg");
return image;
}