예제 #1
0
        public static System.Drawing.Color ToDrawingColor(this StyleColor sColor)
        {
            if (sColor.A == 0)
            {
                return(System.Drawing.Color.Transparent);
            }

            return(System.Drawing.Color.FromArgb(sColor.A, sColor.R, sColor.G, sColor.B));
        }
예제 #2
0
        public static System.Drawing.Pen ToDrawingPen(this StyleColor sColor, float width)
        {
            var pen = new System.Drawing.Pen(sColor.ToDrawingBrush(), width);

            pen.EndCap   = System.Drawing.Drawing2D.LineCap.Round;
            pen.StartCap = System.Drawing.Drawing2D.LineCap.Round;
            pen.LineJoin = System.Drawing.Drawing2D.LineJoin.Round;

            return(pen);
        }
예제 #3
0
 public static System.Drawing.Brush ToDrawingBrush(this StyleColor sColor)
 {
     return(new System.Drawing.SolidBrush(System.Drawing.Color.FromArgb(sColor.A, sColor.R, sColor.G, sColor.B)));
 }
예제 #4
0
 public static StyleColor ToStyleColor(this Color color)
 {
     return(StyleColor.FromArgb(color.A, color.R, color.G, color.B));
 }
예제 #5
0
 public static Color ToColor(this StyleColor sColor)
 {
     return(Color.FromArgb(sColor.A, sColor.R, sColor.G, sColor.B));
 }