Example #1
0
 public static void Pressup()
 {
     lock (Flaglock)
     {
         Flag = 0;
         if (!Tooltype.IsOnlyClickTool())
         {
             Allpoint.Add(new Strokedata(_stroke));
             _stroke.Clear();
         }
     }
 }
Example #2
0
        protected override void OnKeyPress(KeyPressEventArgs e)
        {
            base.OnKeyPress(e);
            switch (e.KeyChar)
            {
            case 'c':
                Tooltype.type = 1;
                Tooltype.line = 3;
                break;

            case 'e':
                Tooltype.type = 2;
                Tooltype.line = 7;
                break;

            case 's':
                if (!Tooltype.IsOnlyClickTool())
                {
                    Tooltype.lasttype = Tooltype.type;
                }
                Tooltype.type = 3;
                break;

            case 'y':
                Tooltype.type = 4;
                break;

            case 'f':
                Tooltype.type = 5;
                break;

            case '1':
                Tooltype.line = 1;
                break;

            case '2':
                Tooltype.line = 2;
                break;

            case '3':
                Tooltype.line = 3;
                break;

            case '4':
                Tooltype.line = 4;
                break;
            }
        }
Example #3
0
 public static void AddPoint(float x, float y)
 {
     if (Flag == 1)
     {
         Pointcount = _stroke.Plist.Count;
         if (!Tooltype.IsOnlyClickTool())
         {
             //if x,y in the windows
             if (Pointcount > 0)
             {
                 if (!_stroke.Plist[Pointcount - 1].x.Equals(x) ||
                     !_stroke.Plist[Pointcount - 1].y.Equals(y))
                 {
                     _stroke.Plist.Add(new Pointdata(x, y));
                 }
             }
             else
             {
                 _stroke.SetTl(Tooltype.type, Tooltype.line);
                 _stroke.Plist.Add(new Pointdata(x, y));
             }
         }
     }
 }