viperchaos

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

在.NET平台中,一种画线方法是:

  通过一bool量来判断鼠标是否按下,如果在MouseMove事件中该bool量为真(在MouseDown里设置)则画一个填充的圆形,典型的代码参考这里

  http://www.java2s.com/Code/CSharp/2D-Graphics/Usingthemousetodrawonaform.htm

  但是这种方法画出来的线是有问题的,如果鼠标拖动过快,拖动的轨迹中会有很有很多空隙,这里http://stackoverflow.com/questions/6036881/c-sharp-drawing-by-mouse给出了解释:

   You will not receive a MouseMove event for every single pixel that the mouse traverses. The OS simply does not give you that level of resolution. Instead you will get the event at intervals. You can see this manifest in the gaps between your ellipses. 

posted on 2012-02-23 15:56  viperchaos  阅读(390)  评论(0编辑  收藏  举报