top of page
Search

Visual Basic Screenshot

GameDestroyer1337

Updated: May 26, 2021

This is what I think is the simplest way to do a screen shot Program in Visual Basic. Visual Basic is an object-oriented coding language developed by Microsoft. Using VB makes it fast and simple to make .NET apps. Visual Basic 16.0 is about supplying more of the excellent features of the VBRuntime to .NET Core and is the first VB version focused on Core. Many pieces of the Visual Basic Runtime need WinForms and these will be added in a later. So let's jump to the tutorial.


Open your VB and Create a New Project to start

Chose Windows Forum Applications first

Follow the steps here


You will add to it:

  • 2 Buttons

  • 1 PictureBox

This is how your project should look like:


Rename Button 1 to "Take Pic" or what ever you like

Rename Button 2 to "Save Pic" or what ever you want

Click on the Picture Box and Click on the arrow in the Up right corner & choose "Stretch Image".


Now For the Programming:


1.Double click "Take Pic" and paste this:

Dim bounds As Rectangle
    Dim screenshot As System.Drawing.Bitmap
    Dim graph As Graphics
    bounds = Screen.PrimaryScreen.Bounds
    screenshot = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
    graph = Graphics.FromImage(screenshot)
    graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
    PictureBox1.Image = screenshot

2.Double click "Save Pic" and paste this:

Dim savefiledialog1 As New SaveFileDialog
    savefiledialog1.Title = "Save File"
    savefiledialog1.FileName = "*.bmp"
    savefiledialog1.Filter = "Bitmap |*.bmp"
    If savefiledialog1.ShowDialog() = DialogResult.OK Then
      PictureBox1.Image.Save(savefiledialog1.FileName, System.Drawing.Imaging.ImageFormat.Bmp)
    End If

3.Save your project and debug it.


I'm pretty sure that you would be able to get much higher fps with big resolution video but you would need to meet hardware requirements like SSD but that's expensive. This is because the limiting factor for recorders is write speeds of a storage because were at the point in were processing power doesn't matter That's why game engines are now being developed in C now over assembly. But if you're interested in more Visual basic stuff, checkout GuidedHacking.com

 
 
 

Recent Posts

See All

コメント


Subscribe Form

Thanks for submitting!

©2023 by FlashTrade. Proudly created with Wix.com

bottom of page