Пример #1
0
        public static void DrawHandle(UI.Controls.Canvas canvas, XGraphics graphics, Palette palette, Rect bounds, DrawingContext context, bool alwaysAlpha, bool round)
        {
            if (bounds.Width <= 0 || bounds.Height <= 0)
            {
                return;
            }

            using (var quality = new Smoothing(graphics, XSmoothingMode.Default))
            {
                XBrush brush;
                Pen    pen;
                var    alpha = 180;

                if (context.Selected)
                {
                    if (!alwaysAlpha)
                    {
                        alpha = 255;
                    }
                    brush = palette.Gradient(bounds, Color.FromArgb(alpha, Color.LemonChiffon), Color.FromArgb(alpha, Color.DarkOrange));
                    pen   = palette.Pen(Color.FromArgb(alpha, Color.Chocolate), 0);
                }
                else
                {
                    brush = palette.Gradient(bounds, Color.FromArgb(alpha, Color.LightCyan), Color.FromArgb(alpha, Color.SteelBlue));
                    pen   = palette.Pen(Color.FromArgb(alpha, Color.Navy), 0);
                }

                if (round)
                {
                    graphics.DrawEllipse(brush, bounds.ToRectangleF());
//          graphics.DrawRectangle(new XPen(Color.Red), bounds.ToRectangleF() );
                    graphics.DrawEllipse(pen, bounds.ToRectangleF());
                }
                else
                {
                    graphics.DrawRectangle(brush, bounds.ToRectangleF());
                    graphics.DrawRectangle(pen, bounds.ToRectangleF());
                }
            }
        }
Пример #2
0
 public virtual void Draw(UI.Controls.Canvas canvas, XGraphics graphics, Palette palette, DrawingContext context)
 {
     Drawing.DrawHandle(canvas, graphics, palette, visualBounds, context, false, true);
 }
Пример #3
0
 public void Draw(UI.Controls.Canvas canvas, XGraphics graphics, Palette palette, DrawingContext context)
 {
   Drawing.DrawHandle(canvas, graphics, palette, bounds, context, false, false);
 }