Пример #1
0
 void ISelectable.DrawSelection(MapGraphics g, RectangleF clipRect, bool designTimeSelection)
 {
     if (this.Shapes.Count != 0)
     {
         MapCore mapCore = this.GetMapCore();
         using (GraphicsPath graphicsPath = this.GetPath(g, false))
         {
             if (graphicsPath != null)
             {
                 RectangleF bounds = graphicsPath.GetBounds();
                 RectangleF rect   = bounds;
                 rect.Inflate(6f, 6f);
                 if (clipRect.IntersectsWith(rect) && !bounds.IsEmpty)
                 {
                     g.DrawSelection(bounds, designTimeSelection, mapCore.SelectionBorderColor, mapCore.SelectionMarkerColor);
                     PointF       centerPointInContentPixels = this.GetCenterPointInContentPixels(g);
                     AntiAliasing antiAliasing = g.AntiAliasing;
                     g.AntiAliasing = AntiAliasing.None;
                     g.DrawLine(Pens.Red, (float)(centerPointInContentPixels.X - 8.0), centerPointInContentPixels.Y, (float)(centerPointInContentPixels.X + 8.0), centerPointInContentPixels.Y);
                     g.DrawLine(Pens.Red, centerPointInContentPixels.X, (float)(centerPointInContentPixels.Y - 8.0), centerPointInContentPixels.X, (float)(centerPointInContentPixels.Y + 8.0));
                     g.AntiAliasing = antiAliasing;
                 }
             }
         }
     }
 }
Пример #2
0
        private void DrawScrew(MapGraphics graph, RectangleF rect)
        {
            Pen pen = new Pen(Color.FromArgb(128, 255, 255, 255), 1f);

            graph.DrawEllipse(pen, rect.X, rect.Y, rect.Width, rect.Height);
            graph.DrawLine(pen, (float)(rect.X + 2.0), (float)(rect.Y + rect.Height - 2.0), (float)(rect.Right - 2.0), (float)(rect.Y + 2.0));
            pen = new Pen(Color.FromArgb(128, Color.Black), 1f);
            graph.DrawEllipse(pen, (float)(rect.X + 1.0), (float)(rect.Y + 1.0), rect.Width, rect.Height);
            graph.DrawLine(pen, (float)(rect.X + 3.0), (float)(rect.Y + rect.Height - 1.0), (float)(rect.Right - 1.0), (float)(rect.Y + 3.0));
        }