Beispiel #1
0
 void Monitor_DrawSquare(object sender, MonitorDrawSquareEventArgs e)
 {
     if (CurrentState == QtreeEditorState.Edit)
     {
         if (!Directory.Exists(QtreeFullPath))
         {
             return;
         }
         var points = new List <PointF>
         {
             new PointF((float)e.Bounds.Left, (float)e.Bounds.Top),
             new PointF((float)e.Bounds.Right, (float)e.Bounds.Top),
             new PointF((float)e.Bounds.Right, (float)e.Bounds.Bottom),
             new PointF((float)e.Bounds.Left, (float)e.Bounds.Bottom),
             new PointF((float)e.Bounds.Left, (float)e.Bounds.Top)
         };
         DrawPolygon(points);
     }
     else if (CurrentState == QtreeEditorState.CreatingQtree)
     {
         NewQtreeBounds = e.Bounds;
         var pol = new Polygon("square", StyleFactory.GetPolygonFromColor(Color.Red, Color.DarkRed));
         pol.AddPoint(new Point("0", e.Bounds.Left, e.Bounds.Top));
         pol.AddPoint(new Point("1", e.Bounds.Right, e.Bounds.Top));
         pol.AddPoint(new Point("2", e.Bounds.Right, e.Bounds.Bottom));
         pol.AddPoint(new Point("3", e.Bounds.Left, e.Bounds.Bottom));
         pol.AddPoint(new Point("4", e.Bounds.Left, e.Bounds.Top));
         Monitor.AddGeometries(LayerGeocercas, pol);
     }
 }
Beispiel #2
0
        protected string GetColor(int nivel, bool locked)
        {
            var color = lvlSel.GetColorForLevel(nivel);

            return(StyleFactory.GetPolygonFromColor(color, locked ? Color.Red : Color.DarkGray));
        }