《急求,在线等》截图并保存成图片的VB代码
1个回答
展开全部
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal Scan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Const VK_SNAPSHOT As Byte = &H2C
Private Sub Command1_Click() '保存整个屏幕图像到文件
keybd_event VK_SNAPSHOT, 0, 0, 0
DoEvents
SavePicture Clipboard.GetData(vbCFBitmap), "c:\abc.bmp"
End Sub
Private Sub Command2_Click() '保存当前应用窗口图像到文件
keybd_event VK_SNAPSHOT, 1, 0, 0
DoEvents
SavePicture Clipboard.GetData(vbCFBitmap), "c:\abc.bmp"
End Sub
Const VK_SNAPSHOT As Byte = &H2C
Private Sub Command1_Click() '保存整个屏幕图像到文件
keybd_event VK_SNAPSHOT, 0, 0, 0
DoEvents
SavePicture Clipboard.GetData(vbCFBitmap), "c:\abc.bmp"
End Sub
Private Sub Command2_Click() '保存当前应用窗口图像到文件
keybd_event VK_SNAPSHOT, 1, 0, 0
DoEvents
SavePicture Clipboard.GetData(vbCFBitmap), "c:\abc.bmp"
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询