public Task RenderDataAsync(List <Geometry> data, Dictionary <string, DrawingStyle> styles, ViewInfo viewInfo, StyleColor?backgroundColor) { return(Task.Run(() => { RenderData(data, styles, viewInfo, backgroundColor); })); }
public void RenderData(List <Geometry> data, Dictionary <string, DrawingStyle> styles, ViewInfo viewInfo, StyleColor?backgroundColor) { try { if (_bitmap == null || _bitmap.Width != viewInfo.Width || _bitmap.Height != viewInfo.Height) { _bitmap = new Bitmap(viewInfo.Width, viewInfo.Height); } using (Graphics g = Graphics.FromImage(_bitmap)) { _backgroundColor = backgroundColor; var background = (backgroundColor.HasValue) ? backgroundColor.Value.ToDrawingColor() : Color.Transparent; g.Clear(background); g.Clip = new Region(new Rectangle(0, 0, viewInfo.Width, viewInfo.Height)); if (!_isHighSpeed) { g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; } else { g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighSpeed; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighSpeed; } if (data != null) { foreach (var geo in data) { DrawGeometery(geo, styles, viewInfo, g); } } } } catch (Exception ex) { var t = ""; } }
public Task RenderDataAsync(List <Geometry> data, ViewInfo viewInfo, StyleColor?backgroundColor) { return(RenderDataAsync(data, new Dictionary <string, DrawingStyle>(), viewInfo, backgroundColor)); }
public Task RenderDataAsync(List <Geometry> data, Dictionary <string, ShapeStyle> styles, ViewInfo viewInfo) { return(RenderDataAsync(data, ConvertStyles(styles), viewInfo, null)); }
public Task RenderDataAsync(SpatialDataSet data, ViewInfo viewInfo, StyleColor?backgroundColor) { return(RenderDataAsync(data.Geometries, ConvertStyles(data.Styles), viewInfo, backgroundColor)); }
public Task RenderDataAsync(List <Geometry> data, ViewInfo viewInfo) { return(RenderDataAsync(data, new Dictionary <string, DrawingStyle>(), viewInfo, null)); }
public Task RenderDataAsync(SpatialDataSet data, ViewInfo viewInfo) { return(RenderDataAsync(data.Geometries, data.Styles, viewInfo)); }
private void DrawPoint(Point point, DrawingStyle style, ViewInfo viewInfo, Graphics g) { DrawPoint(viewInfo.LatLongToPointF(point.Coordinate), style, g); }
private void DrawGeometery(Geometry geom, Dictionary <string, DrawingStyle> styles, ViewInfo viewInfo, Graphics g) { DrawingStyle s = null; if (styles != null && !string.IsNullOrEmpty(geom.StyleKey) && styles.ContainsKey(geom.StyleKey)) { s = styles[geom.StyleKey]; } else if (_defaultStyle != null) { s = _defaultStyle; } DrawGeometery(geom, s, viewInfo, g); }