Ejemplo n.º 1
0
        private static Brush BrushFromString(string s)
        {
            if (s == null)
            {
                return(null);
            }

            Brush b;

            if (HexHelper.IsHexString(s))
            {
                b = new SolidBrush(Color.FromArgb(HexHelper.GetInt(s)));
            }
            else
            {
                b = new SolidBrush(Color.FromName(s));
            }

            return(b);
        }
Ejemplo n.º 2
0
        private static Pen PenFromString(string s)
        {
            if (s == null)
            {
                return(null);
            }

            Pen p;

            if (HexHelper.IsHexString(s))
            {
                p = new Pen(Color.FromArgb(HexHelper.GetInt(s)));
            }
            else
            {
                p = new Pen(Color.FromName(s));
            }

            return(p);
        }