Esempio n. 1
0
 public void OnMouseUp(Point p)
 {
     if (DrawTypes == DrawType.Line)
     {
         //右键起来时,停止绘图,并写入历史记录
         Point[]      pCopy    = CurLine.PointList.ToArray();
         List <Point> lstPoint = new List <Point>();
         lstPoint.AddRange(pCopy);
         LineHistory.Add(new HLine()
         {
             LineColor = CurLine.LineColor, LineWidth = CurLine.LineWidth, PointList = lstPoint
         });
         CurLine.PointList.Clear();
     }
     if (DrawTypes == DrawType.Rect)
     {
         RectHistory.Add(new HRectangle()
         {
             LineColor = CurRect.LineColor, LineWidth = CurRect.LineWidth, Start = CurRect.Start, End = CurRect.End
         });
         CurRect.Start = new Point(0, 0);
         CurRect.End   = new Point(0, 0);
     }
     if (DrawTypes == DrawType.Earser)
     {
         //如果是橡皮擦功能
         //Earser(p);
         Refresh();
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Load history from setting line to list.
        /// </summary>
        static List <string> Read()
        {
            if (String.IsNullOrEmpty(LineHistory))
            {
                return(new List <string>());
            }

            return(new List <string>(LineHistory.Split(separator)));
        }