예제 #1
0
 private void Draw(PaintArgs p, Point centerPoint, Color backColor)
 {
     if (this.Style != MarkerStyleLabel.None)
     {
         Rectangle rectangle;
         if (this.Style == MarkerStyleLabel.Circle)
         {
             p.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
             rectangle = new Rectangle(centerPoint.X - this.Size, centerPoint.Y - this.Size, 2 * this.Size, 2 * this.Size);
             BorderSpecial.DrawEllipse(p, rectangle, this.BevelStyle, 1f, backColor);
             rectangle.Inflate(-2, -2);
             p.Graphics.FillEllipse(p.Graphics.Brush(this.Color), rectangle);
             rectangle.Inflate(2, 2);
             p.Graphics.SmoothingMode = SmoothingMode.Default;
         }
         else if (this.Style == MarkerStyleLabel.Square)
         {
             rectangle = new Rectangle(centerPoint.X - this.Size, centerPoint.Y - this.Size, 2 * this.Size, 2 * this.Size);
             p.Graphics.FillRectangle(p.Graphics.Brush(this.Color), rectangle);
             BorderSpecial.DrawRectangle(p, rectangle, this.BevelStyle, 2, backColor);
         }
         else if (this.Style == MarkerStyleLabel.Line)
         {
             rectangle = new Rectangle(centerPoint.X - this.Size, centerPoint.Y - 1, 2 * this.Size, 2);
             if (this.BevelStyle == BevelStyle.Raised)
             {
                 BorderSimple.Draw(p, rectangle, BorderStyleSimple.RaisedInner, backColor);
             }
             else if (this.BevelStyle == BevelStyle.Sunken)
             {
                 BorderSimple.Draw(p, rectangle, BorderStyleSimple.SunkenInner, backColor);
             }
         }
     }
 }
예제 #2
0
        protected void Draw(PaintArgs p, Rectangle r, ShapeBasic type, BevelStyle style, int thickness, Color color)
        {
            switch (type)
            {
            case ShapeBasic.Rectangle:
                BorderSpecial.DrawRectangle(p, r, style, thickness, color);
                break;

            case ShapeBasic.Ellipse:
                BorderSpecial.DrawEllipse(p, r, style, (float)thickness, color);
                break;

            case ShapeBasic.Diamond:
                BorderSpecial.DrawDiamond(p, r, style, thickness, color);
                break;
            }
        }