如题,以及怎么擦除?谢谢

解决方案 »

  1.   

    C#不能不能再屏幕上划线,C++才可以
    C#只能在窗体上画线
      

  2.   

    http://topic.csdn.net/u/20090309/20/c3257178-0622-42e0-bee2-86980429c6ac.html
      

  3.   

        Declare Function GetDesktopWindow Lib "user32" Alias "GetDesktopWindow" () As Integer
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim H As Integer = GetDesktopWindow
            Using G As Graphics = Graphics.FromHwnd(New IntPtr(H))
                G.Clear(Color.Black)
            End Using
        End Sub
      

  4.   

    擦除实际是重新刷新画图的区域。而重绘画图区域时会触发 Paint 事件,在 Paint 事件里面确保擦除的时候不要在想擦除的地方重新绘制即可,擦除的方法是 Invalidate() 方法。其中可以指定特定的刷新重绘区域。