導航:首頁 > 源碼編譯 > 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仿截圖源碼相關的資料

熱點內容
安卓虛擬機linux 瀏覽:565
安卓怎麼分享五g網路 瀏覽:671
什麼型號的板子能上伺服器內存 瀏覽:397
androidapk圖標設置 瀏覽:42
最早提出分數運演算法的著作 瀏覽:922
安卓郵箱怎麼保存照片 瀏覽:269
hdfspythonapi 瀏覽:851
qt如何搭建web伺服器 瀏覽:58
程序員紅包演算法 瀏覽:792
亞馬遜安全的更換雲伺服器 瀏覽:728
伺服器線程數怎麼設置 瀏覽:605
考研詞彙紅寶書2019pdf 瀏覽:981
如何利用安卓手機wifi修改密碼 瀏覽:373
辭海分冊pdf 瀏覽:935
安卓系統頁面怎麼調 瀏覽:775
壓縮文件的用法 瀏覽:34
如何用瀏覽器訪問伺服器地址 瀏覽:207
soft編譯器 瀏覽:113
三軸車床的編程指令 瀏覽:71
天生敏感pdf 瀏覽:565