English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
所有分類

有沒有辦法寫個程式
自動把鍵盤上\"print screen\"鍵(把桌面抓下來)
自動轉成jpg檔呢?
因為每次都要去小畫家貼上,
然後儲存成jpg
真的是很煩。
用到的機會又特別多
謝謝

2006-03-26 16:08:54 · 1 個解答 · 發問者 strike 5 in 電腦與網際網路 程式設計

您好:
感謝你的回答,我是用vb6企業版,但沒找到Kodak Image Control元件,謝謝

2006-03-28 16:12:30 · update #1

不好意思,
再請教
因為是靠它來存成Jpg,如果還找不到,建議可上網去找別的dll或ocx來用
能不能用小畫家來代替呢?
謝謝

2006-03-29 16:00:20 · update #2

1 個解答

'如果您的VB是企業版的話,請先引用Kodak Image Control元件(別的版本找找看ImgEdit.OCX,不知道有沒有),圖片會以日期為檔名存在C:\'以下在模組Type EVENTMSG        message As Long        paramL As Long        paramH As Long        time As Long        hWnd As LongEnd TypeDeclare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (L As Any, ByVal S&, ByVal C&)Declare Function CallNextHookEx Lib "user32" (ByVal H&, ByVal n&, ByVal W&, L As Any) As LongDeclare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal I&, ByVal L&, ByVal H&, ByVal d&) As LongDeclare Function UnhookWindowsHookEx Lib "user32" (ByVal H&) As LongDeclare Function GetAsyncKeyState Lib "user32" (ByVal v&) As IntegerPublic H As LongFunction HP(ByVal C&, ByVal W&, ByVal L&) As LongDim M As EVENTMSGIf C = 0 Then   CopyMemory M, L, LenB(M)   If M.message = &H101 Then      If GetAsyncKeyState(vbKeySnapshot) Then         DoEvents         With Form1.ImgEdit1              SavePicture Clipboard.GetData(), "C:\Temp.bmp"             .Image = "C:\Temp.bmp"             .Display             .SaveAs "C:\" & Replace(Replace(Now, "/", "_"), ":", "_") & ".jpg", 6, , 6         End With      End If   End IfEnd IfHP = CallNextHookEx(H, C, W, L)End Function'以下在表單Private Sub Form_Load()H = SetWindowsHookEx(0, AddressOf HP, App.hInstance, 0)End SubPrivate Sub Form_Unload(Cancel As Integer)UnhookWindowsHookEx HEnd Sub

2006-03-28 22:37:44 補充:
全名:Kodak Image Edit ControlC:\WINNT\System32\ImgEdit.OCX我記得此元件好像2000以上就有

2006-03-28 22:41:04 補充:
因為是靠它來存成Jpg,如果還找不到,建議可上網去找別的dll或ocx來用

2006-03-28 10:21:22 · answer #1 · answered by W.J.S. 7 · 0 0

fedest.com, questions and answers