public System.Web.Mvc.ActionResult GetAnnotationPng(string jsAnnotation, int?dpi) { byte[] png = null; try { Mark mark = Mark.JsonDeserialize(jsAnnotation); png = AnnoEngine.MarkToPng(mark, this, dpi); } catch (Exception ex) { string key = string.Concat(AstriaCookie.GetToken(), "AnnoEngine"); _cache.Remove(key); png = StandardResult.CreateBitmapImage(ExceptionsML.GetExceptionML(ex).Message); } return(File(png, "image/png")); }
public System.Web.Mvc.ActionResult GetStampsSprite(bool imageStamps) { var client = SvcBldr.StampsV2(); byte[] png = null; try { var sr = client.GetAllForUser(new AnnoStampGetPackage { IncludeAdmin = true, IncludeImage = imageStamps, IncludeDeleted = false }); ExceptionsML.Check(sr.Error); var iStamps = imageStamps ? sr.Result.ImageStamps.Cast <IStamp>() : sr.Result.TextStamps.Cast <IStamp>(); png = AnnoEngine.GetSpriteSheet(iStamps.ToList()); } catch (Exception ex) { string key = string.Concat(AstriaCookie.GetToken(), "AnnoEngine"); _cache.Remove(key); png = StandardResult.CreateBitmapImage(ExceptionsML.GetExceptionML(ex).Message); } return(File(png, "image/png")); }