Esempio n. 1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            var g      = e.Graphics;
            var ratioX = Dpi.GetWidth(1);
            var ratioY = Dpi.GetHeight(1);

            g.FillRectangle(BorderColor.Brush(), new Rectangle(0, 0, Width, Height));
            g.FillRectangle(BackgroundColor.Brush(), new Rectangle(ratioX, ratioY,
                                                                   Width - ratioX * 2, Height - ratioY * 2));
        }
Esempio n. 2
0
        public static Pen ThickPen(this Color color)
        {
            Pen p;

            if (!thickPenCache.TryGetValue(color, out p))
            {
                p           = new Pen(color);
                p.Width     = Dpi.GetWidth(2);
                p.Alignment = PenAlignment.Inset;
                thickPenCache.Add(color, p);
            }

            return(p);
        }
Esempio n. 3
0
        public static Pen DottedPen(this Color color)
        {
            Pen p;

            if (!dottedPenCache.TryGetValue(color, out p))
            {
                p           = new Pen(color);
                p.Alignment = PenAlignment.Inset;
                p.Width     = Dpi.GetWidth(1);
                p.DashStyle = DashStyle.Dot;
                dottedPenCache.Add(color, p);
            }

            return(p);
        }