- Home
·
- Graphics
·
- Screen Capture Module 1.0. Includes a function for capturing the entire screen and dumping it onto
Screen Capture Module 1.0. Includes a function for capturing the entire screen and dumping it onto
Screen Capture Module 1.0. Includes a function for capturing the entire screen and dumping it onto an compatible object with a hDC property.
API Declarations
'by Buttress Root Software
'
'Programmed by Jonathan Liu
'Copyright ©1999-2371 Buttress Root Software. All rights reserved.
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc 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 Const SRCCOPY = &HCC0020
Rate Screen Capture Module 1.0. Includes a function for capturing the entire screen and dumping it onto
(1(1 Vote))
Function CaptureScreen(ByVal sngSourceX As Single, ByVal sngSourceY As Single, _
ByVal sngDestinationX As Single, ByVal sngDestinationY As Single, _
objObject As Object) As Long
On Error GoTo ErrHandler
Dim lngReturn As Long
Dim lngObjectHandle As Long
Dim lngDesktopWindow As Long
Dim lngDesktopDC As Long
Dim sngScreenHeight As Single
Dim sngScreenWidth As Single
lngObjectHandle = objObject.hdc
sngScreenHeight = Screen.Height / Screen.TwipsPerPixelY
sngScreenWidth = Screen.Width / Screen.TwipsPerPixelX
lngDesktopWindow = GetDesktopWindow()
lngDesktopDC = GetDC(lngDesktopWindow)
CaptureScreen = BitBlt(lngObjectHandle, sngDestinationX, sngDestinationY, _
sngScreenWidth, sngScreenHeight, lngDesktopDC, sngSourceX, sngSourceY, _
&HCC0020)
lngReturn = ReleaseDC(lngObjectHandle, lngDesktopDC)
objObject.Refresh
ErrHandler: Exit Function
End Function
Screen Capture Module 1.0. Includes a function for capturing the entire screen and dumping it onto Comments
No comments yet — be the first to post one!
Post a Comment