Beispiel #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);
             }
         }
     }
 }
Beispiel #2
0
        private void DrawLedDiamond3D(PaintArgs p, Rectangle r, IndicatorStyleLED3D style3D, bool active, Color color)
        {
            this.DrawLedDiamond(p, r, color);
            switch (style3D)
            {
            case IndicatorStyleLED3D.Auto:
                BorderSpecial.DrawDiamond(p, r, BevelStyle.Raised, p.Width / 10, this.Bezel.Color);
                break;

            case IndicatorStyleLED3D.Thin:
                BorderSpecial.DrawDiamond(p, r, BevelStyle.Raised, 2, this.Bezel.Color);
                break;
            }
        }
Beispiel #3
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;
            }
        }
Beispiel #4
0
        protected void Draw(PaintArgs p, Rectangle r, BorderStyleControl style, int thickness, Color color)
        {
            switch (style)
            {
            case BorderStyleControl.None:
                return;

            case BorderStyleControl.RoundedSides:
                BorderSpecial.DrawRoundedSides(p, r, BevelStyle.Raised, thickness, color);
                return;

            case BorderStyleControl.Raised:
                if (thickness <= 2)
                {
                    break;
                }
                BorderSpecial.DrawRectangle(p, r, BevelStyle.Raised, thickness, color);
                return;
            }
            if (style == BorderStyleControl.Sunken && thickness > 2)
            {
                BorderSpecial.DrawRectangle(p, r, BevelStyle.Sunken, thickness, color);
            }
            else
            {
                switch (style)
                {
                case BorderStyleControl.Raised:
                    BorderSimple.Draw(p, r, BorderStyleSimple.Raised, color);
                    break;

                case BorderStyleControl.Sunken:
                    BorderSimple.Draw(p, r, BorderStyleSimple.Sunken, color);
                    break;

                case BorderStyleControl.Bump:
                    BorderSimple.Draw(p, r, BorderStyleSimple.Bump, color);
                    break;

                case BorderStyleControl.Etched:
                    BorderSimple.Draw(p, r, BorderStyleSimple.Etched, color);
                    break;

                case BorderStyleControl.Flat:
                    BorderSimple.Draw(p, r, BorderStyleSimple.Flat, color);
                    break;

                case BorderStyleControl.RaisedInner:
                    BorderSimple.Draw(p, r, BorderStyleSimple.RaisedInner, color);
                    break;

                case BorderStyleControl.RaisedOuter:
                    BorderSimple.Draw(p, r, BorderStyleSimple.RaisedOuter, color);
                    break;

                case BorderStyleControl.SunkenInner:
                    BorderSimple.Draw(p, r, BorderStyleSimple.SunkenInner, color);
                    break;

                case BorderStyleControl.SunkenOuter:
                    BorderSimple.Draw(p, r, BorderStyleSimple.SunkenOuter, color);
                    break;
                }
            }
        }