请教如何利用VB加载GDI+
1个回答
展开全部
shell "路径" ;先调用
然后
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private 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()
Me.Hide
Me.AutoRedraw = True
BitBlt Me.hDC, 0, 0, Screen.Width, Screen.Height, GetDC(0), 0, 0, vbSrcCopy
sFile$ = "C:\" & Format(Now, "mmddhhmmss") & ".BMP"
SavePicture Me.Image, sFile
MsgBox "当前屏幕图像已经保存到" & sFile, 64
End
End Sub ;保存截图
然后
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private 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()
Me.Hide
Me.AutoRedraw = True
BitBlt Me.hDC, 0, 0, Screen.Width, Screen.Height, GetDC(0), 0, 0, vbSrcCopy
sFile$ = "C:\" & Format(Now, "mmddhhmmss") & ".BMP"
SavePicture Me.Image, sFile
MsgBox "当前屏幕图像已经保存到" & sFile, 64
End
End Sub ;保存截图
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询