![]() ![]() These functions are Windows functions inside a DLL file. Private Declare Function DeleteObject Lib "GDI32" _ Private Declare Function DeleteDC Lib "GDI32" _ Private Declare Function BitBlt Lib "GDI32" _īyVal srcX As Integer, ByVal srcY As Integer, _īyVal srcW As Integer, ByVal srcH As Integer, _īyVal desthDC As Integer, ByVal destX As Integer, _īyVal destY As Integer, ByVal op As Integer) As Integer (ByVal hDC As Integer, ByVal hObject As Integer) As Integer ![]() Private Declare Function SelectObject Lib "GDI32" _ Private Declare Function GetDeviceCaps Lib "gdi32" Alias _ (ByVal hDC As Integer, ByVal nWidth As Integer, _ Private Declare Function CreateCompatibleBitmap Lib "GDI32" _ Private Declare Function CreateCompatibleDC Lib "GDI32" _ "CreateDCA" (ByVal lpDriverName As String, _īyVal lpDeviceName As String, ByVal lpOutput As String, _ The CodeĪdd the following code just below your Class declaration: Private Declare Function CreateDC Lib "gdi32" Alias _ ![]() This ensures the Picturebox fills up the entire form. Set the PictureBox’s Dock Property to Fill. You may name it anything you like, but keep in mind that I have kept the default names. This will ensure the form is shown full screen.Īdd a PictureBox to your Form. Set the Form’s WindowState property to Maximized. ![]() Our Project DesignĬreate a new Visual Basic Windows Forms project and name it Screen Capture. We need to make use of the specific methods inside the specific Windows DLL files to create a screen capture. The methods of the programs are locked away in these files, and these methods make your applications work. These files are dynamically linked with the Operating System to run the associated program with it. The Windows system, or any system for that matter, is made of a bunch of files, called DLLs amongst others. Then, you get the functions that run in the background and you usually do not have to care about: keeping track of memory usage, obtaining a list of running programs. You have to remember that, in running Windows, you are indirectly executing code exposed by the Windows Operating System.Ī simple action, such as opening a file, executes the desired functionality needed for the file to be run. Any good program exposes some sort of API that can be used in other applications. The term API means Application Programming Interface. This technology is known as the Winodws API. The Windows APIīefore explaining how to make a screen capture, I need to speak about the background technology used to copy the screen’s content into a file compatible with a drawing program. Everyone, especially newbies, wants to know this hence, this article. Today’s topic is quite a frequent topic on the forums. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |