Ejemplo n.º 1
0
 private void InitDrawingStyle()
 {
     this.m_RectangleStyle = new GeoPolygonStyle();
     this.m_RectangleStyle.Color = Color.Blue;
     this.m_RectangleStyle.IsFillPolygon = true;
     this.m_RectangleStyle.FillColor = Color.FromArgb(90, Color.Yellow);
 }
Ejemplo n.º 2
0
 public void AddOrUpdatePolygonRegions(List<GeoPolygonRegion> regions, Color fillColor, bool visible)
 {
     GeoPolygonStyle style = new GeoPolygonStyle {
         IsFillPolygon = true,
         FillColor = fillColor,
         Visible = visible
     };
     foreach (GeoPolygonRegion region in regions)
     {
         if (this.m_PolygonRegionStyleDict.ContainsKey(region))
         {
             this.m_PolygonRegionStyleDict.Remove(region);
         }
         this.m_PolygonRegionStyleDict.Add(region, style);
     }
     this.RaiseDataChangedEvent(this, new EventArgs());
 }
Ejemplo n.º 3
0
 public static GeoPolygonStyle GenerateDefaultPolygonStyle()
 {
     GeoPolygonStyle style = new GeoPolygonStyle();
     style.LineWidth = 2f;
     style.LineDashStyle = DashStyle.Solid;
     style.Color = Color.DarkBlue;
     style.FillColor = Color.FromArgb(0, 0, 0, 0);
     style.LabelFont = new Font("Arial", 9f);
     style.LabelColor = Color.Black;
     style.SelectedLabelColor = Color.MediumVioletRed;
     style.IsShowVertex = true;
     style.IsShowLabel = true;
     style.RegionAsSelected = false;
     style.VertexSize = new Size(4, 4);
     style.VertexStyle = PointSymbolStyle.SolidSquare;
     style.VertexFillColor = Color.DarkBlue;
     style.VertexEdgeColor = Color.Transparent;
     style.VertexSelectedSize = new Size(6, 6);
     style.VertextSelectedStyle = PointSymbolStyle.HollowSquare;
     style.VertexSelectedFillColor = Color.White;
     style.VertexSelectedEdgeColor = Color.Blue;
     return style;
 }
Ejemplo n.º 4
0
 public void AddPolygonRegion(GeoPolygonRegion polygon, GeoPolygonStyle polygonStyle)
 {
     Dictionary<GeoPolygonRegion, GeoPolygonStyle> polygons = new Dictionary<GeoPolygonRegion, GeoPolygonStyle>();
     polygons.Add(polygon, polygonStyle);
     this.AddPolygonRegions(polygons);
 }
Ejemplo n.º 5
0
 private void GenerateDefaultStyle()
 {
     this.m_DefaultPointStyle = new GeoPointStyle();
     this.m_DefaultLineStyle = new GeoLineStyle();
     this.m_DefaultPolygonStyle = new GeoPolygonStyle();
 }
Ejemplo n.º 6
0
 private GraphicsPath BuildPolygonRegionStyle(GeoPolygonRegion region, GeoPolygonStyle regionStyle, Rectangle FormRectangle)
 {
     GraphicsPath path = new GraphicsPath();
     Dictionary<List<Point>, bool> screenPoints = this.GetScreenPoints(region, new Point());
     foreach (List<Point> list in screenPoints.Keys)
     {
         Point[] pts = this.FilterToPointArray(list.ToArray());
         if (pts.Length >= 3)
         {
             Point[] points = null;
             if (this.IsAllPointsInRect(pts, FormRectangle))
             {
                 points = pts;
             }
             else
             {
                 Point[] pointArray = new Point[] { FormRectangle.Location, new Point(FormRectangle.Right, FormRectangle.Top), new Point(FormRectangle.Right, FormRectangle.Bottom), new Point(FormRectangle.Left, FormRectangle.Bottom) };
                 Polygon polygon = this.BuildGpcPolygonFromPointArray(pointArray);
                 Polygon polygon2 = this.BuildGpcPolygonFromPointArray(pts);
                 points = GpcWrapper.Clip(GpcOperation.Intersection, polygon, polygon2).ToPointArray();
             }
             if (points.Length > 2)
             {
                 if (regionStyle.RegionAsSelected)
                 {
                     path.AddPolygon(points);
                 }
                 else
                 {
                     Point[] array = new Point[points.Length + 1];
                     points.CopyTo(array, 0);
                     array[array.Length - 1] = array[0];
                     path.AddLines(array);
                 }
             }
         }
     }
     if (!regionStyle.RegionAsSelected)
     {
         this.m_WidenPen.Width = regionStyle.LineWidth + 6f;
         path.Widen(this.m_WidenPen);
     }
     return path;
 }
Ejemplo n.º 7
0
 private GeoPolygonStyle BuildPolygonStyle(BrushStyle brStyle, PenStyle penStyle)
 {
     GeoPolygonStyle style = new GeoPolygonStyle();
     if (penStyle != null)
     {
         style.LineWidth = penStyle.PenWidth;
         style.Color = penStyle.PenColor;
     }
     if (brStyle != null)
     {
         style.IsFillPolygon = true;
         style.FillColor = brStyle.ForeColor;
     }
     return style;
 }
Ejemplo n.º 8
0
 public GeoDisplayPolygonRegion(GeoPolygonRegion region, GeoPolygonStyle style)
 {
     this.m_Region = region;
     base.m_Style = style;
     base.AddFeature("VectorStyle", style);
 }