新建一个工程,在窗体上布置一个pictruebox和一个command,加入如下代码,就能将整个屏幕显示在pictruebox中,希望对你有所帮助: Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc 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 nSrcWidth As Long, _ ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long Private Sub Command1_Click() Dim wScreen As Long Dim hScreen As Long Dim w As Long Dim h As Long Picture1.ClswScreen = Screen.Width \ Screen.TwipsPerPixelX hScreen = Screen.Height \ Screen.TwipsPerPixelYPicture1.ScaleMode = vbPixels w = Picture1.ScaleWidth h = Picture1.ScaleHeighthdcScreen = GetDC(0)r = StretchBlt(Picture1.hdc, 0, 0, w, h, hdcScreen, _ 0, 0, wScreen, hScreen, vbSrcCopy)End Sub
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc 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 nSrcWidth As Long, _
ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Private Sub Command1_Click()
Dim wScreen As Long
Dim hScreen As Long
Dim w As Long
Dim h As Long
Picture1.ClswScreen = Screen.Width \ Screen.TwipsPerPixelX
hScreen = Screen.Height \ Screen.TwipsPerPixelYPicture1.ScaleMode = vbPixels
w = Picture1.ScaleWidth
h = Picture1.ScaleHeighthdcScreen = GetDC(0)r = StretchBlt(Picture1.hdc, 0, 0, w, h, hdcScreen, _
0, 0, wScreen, hScreen, vbSrcCopy)End Sub
如果要实时的动态画面,建议使用DV.
间隔多久执行一次sendkeys {PRTSC},然后把剪切板里的图片写到一个文件图片文件里面,这样就可以了,然后把他们连续的显示出来,就可以了,不知道这样是否能满足你的要求