获取桌面图象

页面导航:首页 > 软件编程 > vb.net > 获取桌面图象

获取桌面图象

来源: 作者: 时间:2016-02-05 12:32 【

Public Declare Function GetDesktopWindow Lib "user32" () As LongPublic Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As LongPublic Declare Function BitBlt Lib "

 

 

Public Declare Function GetDesktopWindow Lib "user32" () As Long

Public Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long

Public Declare Function BitBlt Lib "gdi32" _

(ByVal hDestDC As Long, _

ByVal x As Long, _

ByVal y As Long, _

ByVal nWidth As Long, _

ByVal nHeight As Long, _

ByVal hSrcDC As Long, _

ByVal xSrc As Long, _

ByVal ySrc As Long, _

ByVal dwRop As Long) As Long

 

Private Sub Form_Load()

Dim lDesktop As Long

Dim lDC As Long

Form1.AutoRedraw = True

Form1.ScaleMode = 1

lDesktop = GetDesktopWindow() 取得桌面窗口

lDC = GetDC(lDesktop) 取得桌面窗口的设备场景

BitBlt Me.hDC, 0, 0, Screen.Width, Screen.Height, lDC, 0, 0, vbSrcCopy 将桌面图象绘制到窗体

End Sub

 

 

 

Tags:

相关文章

    文章评论

    最 近 更 新
    热 点 排 行
    Js与CSS工具
    代码转换工具
    
    <