asp.net web api返回图片至前端

 var response = Request.CreateResponse(HttpStatusCode.OK);
 response.Content = new ByteArrayContent(data);  //data为二进制图片数据
 response.Content.Headers.ContentType = new MediaTypeHeaderValue("image/png");

 return response;
原文地址:https://www.cnblogs.com/guokun/p/5843857.html