导航:首页 > 源码编译 > 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仿截图源码相关的资料

热点内容
墨镜慧眼怎么下载厂商的app 浏览:59
iphone加密专线 浏览:491
aes产生加密文件 浏览:411
编程实现蓝牙通信 浏览:766
怎么恢复掉签的app 浏览:847
服务器部署ip地址 浏览:321
涉密场所周边安全防护距离算法 浏览:672
安卓fpse模拟器怎么设置加速 浏览:946
建行app怎么生成电子签章 浏览:508
获取当前时间javadate 浏览:73
带密码的wifi如何加密 浏览:237
服务器怎么变成阵列 浏览:718
web前端黑客技术pdf 浏览:71
育儿百科全书pdf 浏览:600
任务栏启动命令 浏览:912
编译优化等级区别 浏览:757
unix网关命令 浏览:877
想自己做网站要学编程吗 浏览:597
租个服务器开个私服需要什么 浏览:273
图片换成pdf格式 浏览:664