导航:首页 > 源码编译 > vb仿截图源码

vb仿截图源码

发布时间:2024-04-21 17:26:11

❶ vb 求”当前窗体“截图源码 ,并可以保存到文件 每秒钟截几张,越简单越好。

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 Declare Function GetActiveWindow Lib "user32" () As Long
Dim a
Private Sub Command1_Click()
a = 0
Timer1.Enabled = True
End Sub
Private Sub Form_Load()

On Error Resume Next

Me.Height = Screen.Height
Me.Width = 5000

MkDir "D:\zt" '建文件夹
Me.AutoRedraw = True
Pic1.AutoRedraw = True
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
a = a + 1
Me.Hide
If a = 3 Then '三秒后开始抓屏

BitBlt Me.hdc, 0, 0, Screen.Width, Screen.Height, _
GetDC(GetActiveWindow), 0, 0, vbSrcCopy '抓屏
'BitBlt Me.hDC, 0, 0, 200, 200, GetDC(GetActiveWindow), 100, 100, vbSrcCopy '抓屏
Me.Show
Dim sFile As String
sFile = "D:\zt\" & Format(Now, "yyyymmddhhmmss") & ".BMP"
'Pic1.Picture = sFile
SavePicture Me.Image, sFile '保存Me.hDC
Timer1.Enabled = False
End If
End Sub

自己再修改修改时间,保存路径等
祝你好运!

阅读全文

与vb仿截图源码相关的资料

热点内容
c程序员做什么工作 浏览:555
微信源码怎么关闭 浏览:261
风险区牛熊区狙击点源码 浏览:815
python变量如何表示虚数 浏览:286
诛仙1服务器怎么改名 浏览:273
ppt的超链接命令的作用是 浏览:89
如何用git拉取服务器代码 浏览:369
锤子系统有文件加密吗 浏览:877
程序员主动离职和被裁员哪个好 浏览:792
360命令行 浏览:726
程序员骗色 浏览:668
cisco2950重启命令 浏览:459
加密货币区块链可以增发吗 浏览:290
黄龙公式源码 浏览:773
linux系统ftp服务器 浏览:321
山西配电服务器机柜云主机 浏览:452
量化选股模型公式源码 浏览:9
龙卡购车分期怎么绑app 浏览:779
python读取bios信息 浏览:113
程序员老爸初体验 浏览:729