public static void Pressup() { lock (Flaglock) { Flag = 0; if (!Tooltype.IsOnlyClickTool()) { Allpoint.Add(new Strokedata(_stroke)); _stroke.Clear(); } } }
protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); if (Pointtrace.Flag == 1) { if (Tooltype.IsChalkorEra()) { Pointtrace.AddPoint(((float)(2 * e.X - this.Width)) / this.Width, (float)(this.Height - 2 * e.Y) / this.Height); } } }
public void Render(List <Strokedata> strokelist, Strokedata stroke) { int curtype = stroke.Type; this.shaderfile = Tooltype.Getfx(stroke.Type); Compilevertex(); Compilepixel(); if (stroke.Plist.Count > 0) { Createvertex(stroke); } _swapchain.Present(0, PresentFlags.None); }
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; } }
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)); } } } }