public ActionResult GetBulletinImage(string userToken, string culture = "en", bool isTesting = false) { var title = culture == "en" ? "Your Feelings With Other People" : "Vos sentiments avec d'autres personnes"; var data = GetBulletinData(userToken, culture, isTesting); Image img = StcGraphics.GetBulletinGraph2D(data, 350, 350, title, 10, true); using (var ms = new MemoryStream()) { img.Save(ms, ImageFormat.Jpeg); return(File(ms.ToArray(), "image/jpeg")); } }
public HttpResponseMessage GetBulletinImage(string userToken, string culture = "en") { var title = EsmResource.GetString("Your Feelings with Other People", culture); var data = GetBulletinData(userToken, culture); Image img = StcGraphics.GetBulletinGraph2D(data, 410, 350, title, 12, true); using (var ms = new MemoryStream()) { img.Save(ms, ImageFormat.Jpeg); var result = new HttpResponseMessage(HttpStatusCode.OK); result.Content = new ByteArrayContent(ms.ToArray()); result.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("image/jpeg"); return(result); } }