|
-
Mar 10th, 2000, 09:19 AM
#1
Thread Starter
Member
Hi,
I'm developing a program for work that need to capture the current screen and save it as some sort of graphic file (like a screen capture). I think there should be some kind of api routine that will do the trick, but I'm not sure. Please Help
Thanks
Richard Lange
[email protected]
-
Mar 10th, 2000, 10:23 AM
#2
Hi, I took this code from one example from this site but add the save feature.
Code:
Private Declare Function GetDesktopWindow Lib "user32" () As Long
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 Sub Form_Load()
Dim A As Long
Dim s As Long
Form1.AutoRedraw = True
Form1.ScaleMode = 1
A = GetDesktopWindow()
s = GetDC(A)
BitBlt Me.hDC, 0, 0, Screen.Width, Screen.Height, s, 0, 0, vbSrcCopy
SavePicture Me.Image, "image.bmp"
End Sub
Kayan.
-
Mar 12th, 2000, 10:00 PM
#3
New Member
Hi
what if a want to save and send a form as a bmp file to a mail receptionist. I can start up my outlook express and want to send a form with e-mail.
Hi, I took this code from one example from this site but add the save feature.
Code:
Private Declare Function GetDesktopWindow Lib "user32" () As Long
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 Sub Form_Load()
Dim A As Long
Dim s As Long
Form1.AutoRedraw = True
Form1.ScaleMode = 1
A = GetDesktopWindow()
s = GetDC(A)
BitBlt Me.hDC, 0, 0, Screen.Width, Screen.Height, s, 0, 0, vbSrcCopy
SavePicture Me.Image, "image.bmp"
End Sub
Kayan.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|