Пример #1
0
 //pbimg"鼠标移动"事件处理方法
 private void pbImg_MouseMove(object sender, MouseEventArgs e)
 {
     //Thread.Sleep(6);//减少cpu占用率
     //mousePostion.Text = e.Location.ToString();
     if (dt.startDraw)
     {
         pList.Add(e.Location);
         dt.DrawDot(e);
         label2.Text = "Mouse-Position: X: " + e.X + "\r\n" + "Mouse-Position: Y: " + e.Y;
     }
     if (pList.Count > 0)
     {
         button3.Enabled = true;
     }
 }
Пример #2
0
        //pbimg"鼠标移动"事件处理方法
        private void pbImg_MouseMove(object sender, MouseEventArgs e)
        {
            Thread.Sleep(6);//减少cpu占用率
            mousePostion.Text = e.Location.ToString();
            if (dt.startDraw)
            {
                switch (sType)
                {
                case "Dot": dt.DrawDot(e); break;

                case "Eraser": dt.Eraser(e); break;

                default: dt.Draw(e, sType); break;
                }
            }
        }