private Bitmap RenderGaugeControl(ASPxGaugeControl gauge) { using (var stream = new MemoryStream()) { gauge.ExportToImage(stream, System.Drawing.Imaging.ImageFormat.Png); return(new Bitmap(stream)); } }
public ActionResult RenderGauge(float param) { ASPxGaugeControl ctrl = new ASPxGaugeControl(); ctrl.RestoreLayoutFromXml(Server.MapPath("~/App_Data/gauge.xml")); (ctrl.Gauges["myGauge"] as CircularGauge).Scales["myScale"].Value = param; MemoryStream stream = new MemoryStream(); ctrl.ExportToImage(stream, ImageFormat.Png); stream.Seek(0, SeekOrigin.Begin); return(File(stream, "image/png")); }