VB.net 2010 视频教程 VB.net 2010 视频教程 python基础视频教程
SQL Server 2008 视频教程 c#入门经典教程 Visual Basic从门到精通视频教程
当前位置:
首页 > VB.net教程 >
  • VB.net 保存窗体截图源代码

Public Sub ScreenShot()
    Dim bit As Bitmap = New Bitmap(Me.Width, Me.Height)
    Dim g As Graphics = Graphics.FromImage(bit)
    g.CompositingQuality = Drawing2D.CompositingQuality.HighSpeed
    g.CopyFromScreen(Me.Left, Me.Top, 0, 0, New Size(Me.Width, Me.Height))
    Try
        bit.Save("D:\tmp\1.png")
        lst_Log.Items.Add("保存截图成功")
    Catch ex As Exception
        MsgBox("保存截图失败 " & ex.Message)
    End Try
End Sub

相关教程