用VB获取桌面图象

2008-02-23 06:56:19来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折

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

上一篇: 简单介绍透明位图的实现方法
下一篇: 将图片「非重叠显示」填满整个表格视窗

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:VB调用IMAGE控件实现图像缩放的一种方法

下一篇:创建ActiveX接口以移植Excel工作表