コード例 #1
0
 public Task RenderDataAsync(List <Geometry> data, Dictionary <string, DrawingStyle> styles, ViewInfo viewInfo, StyleColor?backgroundColor)
 {
     return(Task.Run(() =>
     {
         RenderData(data, styles, viewInfo, backgroundColor);
     }));
 }
コード例 #2
0
        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 = "";
            }
        }
コード例 #3
0
 public Task RenderDataAsync(List <Geometry> data, ViewInfo viewInfo, StyleColor?backgroundColor)
 {
     return(RenderDataAsync(data, new Dictionary <string, DrawingStyle>(), viewInfo, backgroundColor));
 }
コード例 #4
0
 public Task RenderDataAsync(List <Geometry> data, Dictionary <string, ShapeStyle> styles, ViewInfo viewInfo)
 {
     return(RenderDataAsync(data, ConvertStyles(styles), viewInfo, null));
 }
コード例 #5
0
 public Task RenderDataAsync(SpatialDataSet data, ViewInfo viewInfo, StyleColor?backgroundColor)
 {
     return(RenderDataAsync(data.Geometries, ConvertStyles(data.Styles), viewInfo, backgroundColor));
 }
コード例 #6
0
 public Task RenderDataAsync(List <Geometry> data, ViewInfo viewInfo)
 {
     return(RenderDataAsync(data, new Dictionary <string, DrawingStyle>(), viewInfo, null));
 }
コード例 #7
0
 public Task RenderDataAsync(SpatialDataSet data, ViewInfo viewInfo)
 {
     return(RenderDataAsync(data.Geometries, data.Styles, viewInfo));
 }
コード例 #8
0
 private void DrawPoint(Point point, DrawingStyle style, ViewInfo viewInfo, Graphics g)
 {
     DrawPoint(viewInfo.LatLongToPointF(point.Coordinate), style, g);
 }
コード例 #9
0
        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);
        }