你好,你可以尝试一下 下面的vb截图代码:可以截取picture2控件的:
添加一个picture1,picture2 和一个command1。picture2中你可以任意放控件,都可以成功截取。保存为vbBMP
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 Command1_Click()
Picture1AutoRedraw = True
Picture1Width = Picture2Width
Picture1Height = Picture2Height
'pictrue1visible=false
BitBlt Picture1hDC, 0, 0, Picture2Width, Picture2Height, GetDC(Picture2hwnd), 0, 0, vbSrcCopy '抓屏
Dim sFile As String
sFile = AppPath & "\vbBMP"
Set Picture1Picture = Picture1Image
SavePicture Picture1Picture, sFile '保存
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)