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

熱點內容
javamidi編程 瀏覽:831
android60demo 瀏覽:65
頭條演算法怎麼復習 瀏覽:512
燈光控制通道可以編程設置嗎 瀏覽:781
webpack命令行 瀏覽:805
卸載雲伺服器操作系統 瀏覽:29
java文件移動文件夾 瀏覽:449
針織公斤足稱演算法 瀏覽:457
電腦下載的圖片從文件夾重新編組 瀏覽:645
安卓源碼編譯引導失敗 瀏覽:676
蘋果怎麼添加自定義app文件夾 瀏覽:930
橙牛app怎麼找客服 瀏覽:307
php對象魔術方法 瀏覽:487
OBV能量潮幅圖指標源碼 瀏覽:913
編程15個好習慣 瀏覽:676
電腦u盤文件夾顯示屏幕保護程序 瀏覽:801
我的世界伺服器版本怎麼下載 瀏覽:600
c代碼加密工具 瀏覽:357
使用泛型演算法的錯誤 瀏覽:739
單片機焊接要焊接多少個引腳 瀏覽:671