Example #1
0
        public object Clone()
        {
            DrawStyle ret = new DrawStyle();

            ret.initFromColor(Font, SkillFill, SkillEdge, ArrowLine, ArrowEdge, ArrowFill);
            return(ret);
        }
Example #2
0
        private void drawSkill(PointF _center, Skill curr_skill, DrawStyle curr_style)
        {
            Point     center = Point.Round(_center);
            int       r = size_circle;
            int       stx = center.X - r, sty = center.Y - r;
            int       d    = r * 2;
            Rectangle rect = new Rectangle(stx, sty, d, d);

            if (curr_style.SkillEdge.IsEmpty == false)
            {
                Pen edgePen;
                edgePen       = new Pen(curr_style.SkillEdge);
                edgePen.Width = lineW;
                buffer.DrawEllipse(edgePen, rect);
            }
            if (curr_style.SkillFill.IsEmpty == false)
            {
                Brush fillBush = new SolidBrush(curr_style.SkillFill);
                buffer.FillEllipse(fillBush, rect);
            }
            Brush fontbush;

            fontbush = new SolidBrush(curr_style.Font);

            Point fontSize        = (Point)getNameSize(curr_skill.name);
            Point DrawStringPoint = center;

            Geom.scale(ref fontSize, 1, 2);
            DrawStringPoint -= (Size)fontSize;
            buffer.DrawString(curr_skill.name, font_name, fontbush, DrawStringPoint);
        }
Example #3
0
        private void drawSkill(PointF _center, Skill curr_skill, DrawStyle curr_style)
        {
            Point center = Point.Round(_center);
            int r = size_circle;
            int stx = center.X - r, sty = center.Y - r;
            int d = r * 2;
            Rectangle rect = new Rectangle(stx, sty, d, d);
            if (curr_style.SkillEdge.IsEmpty == false)
            {
                Pen edgePen;
                edgePen = new Pen(curr_style.SkillEdge);
                edgePen.Width = lineW;
                buffer.DrawEllipse(edgePen, rect);
            }
            if (curr_style.SkillFill.IsEmpty == false)
            {
                Brush fillBush = new SolidBrush(curr_style.SkillFill);
                buffer.FillEllipse(fillBush, rect);
            }
            Brush fontbush;
            fontbush = new SolidBrush(curr_style.Font);

            Point fontSize = (Point)getNameSize(curr_skill.name);
            Point DrawStringPoint = center;
            Geom.scale(ref fontSize, 1, 2);
            DrawStringPoint -= (Size)fontSize;
            buffer.DrawString(curr_skill.name, font_name, fontbush, DrawStringPoint);
        }
Example #4
0
 public void initInString(string[] lists)
 {
     bg = ColorTranslator.FromHtml(lists[0]);
     int DSlength = DrawStyle.length;
     for (int i = 0; i < 3; i++)
     {
         ds[i] = new DrawStyle(lists[i * DSlength + 1]
                             , lists[i * DSlength + 2]
                             , lists[i * DSlength + 3]
                             , lists[i * DSlength + 4]
                             , lists[i * DSlength + 5]
                             , lists[i * DSlength + 6]);
     }
 }
Example #5
0
 private void DrawArrow(Point[] PointList, DrawStyle currStyle)
 {
     if (currStyle.ArrowFill.IsEmpty == false)
     {
         Brush fillBush = new SolidBrush(currStyle.ArrowFill);
         buffer.FillPolygon(fillBush, PointList);
     }
     if (currStyle.ArrowEdge.IsEmpty == false)
     {
         Pen edgePen = new Pen(currStyle.ArrowEdge);
         edgePen.Width = lineW;
         buffer.DrawPolygon(edgePen, PointList);
     }
 }
Example #6
0
        public void initInString(string[] lists)
        {
            bg = ColorTranslator.FromHtml(lists[0]);
            int DSlength = DrawStyle.length;

            for (int i = 0; i < 3; i++)
            {
                ds[i] = new DrawStyle(lists[i * DSlength + 1]
                                      , lists[i * DSlength + 2]
                                      , lists[i * DSlength + 3]
                                      , lists[i * DSlength + 4]
                                      , lists[i * DSlength + 5]
                                      , lists[i * DSlength + 6]);
            }
        }
Example #7
0
        private void DrawArrow(PointF _st, PointF _ed, DrawStyle start)
        {
            Point st     = Point.Round(_st);
            Point ed     = Point.Round(_ed);
            int   length = Geom.Distance(st, ed);

            if (length <= size_circle * 2)
            {
                return;
            }
            Point[] pointList = Geom.getArrowHead(st, ed, size_circle);
            Geom.scaleLine(ref st, ref ed, size_circle);
            if (start.ArrowLine.IsEmpty == false)
            {
                Pen edPen = new Pen(start.ArrowLine);
                edPen.Width = lineW;
                buffer.DrawLine(edPen, st, pointList[0]);
            }
            DrawArrow(pointList, start);
        }
Example #8
0
 public void loadByIndex(int index, DrawStyle inp)
 {
     ds[index] = inp;
 }
Example #9
0
 public ColorScheme()
 {
     bg = Color.Empty;
     ds[0] = ds[1] = ds[2] = new DrawStyle();
 }
Example #10
0
 private void DrawArrow(Point[] PointList, DrawStyle currStyle)
 {
     if (currStyle.ArrowFill.IsEmpty == false)
     {
         Brush fillBush = new SolidBrush(currStyle.ArrowFill);
         buffer.FillPolygon(fillBush, PointList);
     }
     if (currStyle.ArrowEdge.IsEmpty == false)
     {
         Pen edgePen = new Pen(currStyle.ArrowEdge);
         edgePen.Width = lineW;
         buffer.DrawPolygon(edgePen, PointList);
     }
 }
Example #11
0
 private void DrawArrow(PointF _st, PointF _ed, DrawStyle start)
 {
     Point st = Point.Round(_st);
     Point ed = Point.Round(_ed);
     int length = Geom.Distance(st, ed);
     if (length <= size_circle * 2)
         return;
     Point[] pointList = Geom.getArrowHead(st, ed, size_circle);
     Geom.scaleLine(ref st, ref ed, size_circle);
     if (start.ArrowLine.IsEmpty == false)
     {
         Pen edPen = new Pen(start.ArrowLine);
         edPen.Width = lineW;
         buffer.DrawLine(edPen, st, pointList[0]);
     }
     DrawArrow(pointList, start);
 }
Example #12
0
 public void loadByIndex(int index, DrawStyle inp)
 {
     ds[index] = inp;
 }
Example #13
0
 public ColorScheme()
 {
     bg    = Color.Empty;
     ds[0] = ds[1] = ds[2] = new DrawStyle();
 }
Example #14
0
 public object Clone()
 {
     DrawStyle ret = new DrawStyle();
     ret.initFromColor(Font, SkillFill, SkillEdge, ArrowLine, ArrowEdge, ArrowFill);
     return ret;
 }