Page 1 of 1

Make a screen Capture Program

Posted: Mon Jun 07, 2010 1:34 pm
by shabs
Hi Again,

See here a program to capture your screen

You Need...
2 Buttons ( Button 1 "Capture" Button 2 "Save")
1 Picture Box (make its size as bigger as possible)(forpreview)
1 Save File Dialog

Add the following code to Capture Button
Code: Select all
Dim bounds As Rectangle
        Dim screenshots As System.Drawing.Bitmap
        Dim graph As Graphics
        bounds = Screen.PrimaryScreen.Bounds
        screenshots = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
        graph = Graphics.FromImage(screenshots)
        graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
        PictureBox1.Image = screenshots
Add the following code to Capture Button
Code: Select all
Dim SaveFileDialog1 As New SaveFileDialog
        Try
            SaveFileDialog1.Title = "Save Image"
            SaveFileDialog1.FileName = "*.jpg"
            SaveFileDialog1.Filter = "JPEGp| *.jpg"

            If SaveFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
                PictureBox1.Image.Save(SaveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Jpeg)
            End If

        Catch ex As Exception

        End Try
It works..

You can also change the image format or give option as shown in my Previous Tutorial

Regards
Shahbaz Singh

Re: Make a screen Capture Program

Posted: Mon Jun 07, 2010 9:01 pm
by mikethedj4
This has been done so many times, and here's a faster way to capture your screen. Press the "Print Screen" button (PrtSc right by the backspace)

Re: Make a screen Capture Program

Posted: Mon Jun 07, 2010 10:15 pm
by GoodGuy17
I have already made a tutorial on this, but thanks for trying to contribute to the site at least! cooll;

Re: Make a screen Capture Program

Posted: Tue Jun 08, 2010 3:10 pm
by Lewis
mikethedj4 wrote:
This has been done so many times, and here's a faster way to capture your screen. Press the "Print Screen" button (PrtSc right by the backspace)
Nice and true, and easy :)

Re: Make a screen Capture Program

Posted: Tue Jun 08, 2010 5:55 pm
by GoodGuy17
mikethedj4 wrote:
This has been done so many times, and here's a faster way to capture your screen. Press the "Print Screen" button (PrtSc right by the backspace)
Yeah, but with that you have to PrtSc, then paint, then paste in paint, then save. With this, it is push button, push save. IMO PrtSc is not faster...

Re: Make a screen Capture Program

Posted: Wed Jun 09, 2010 1:55 am
by CodenStuff
Hello shabs,

Good work and if you combine it with the image convertor code you posted you will have yourself a great little screen capture tool.

Its true that we have had similar codes posted before but its always good to see new members posting their codes ;). Keep it up cooll;

Re: Make a screen Capture Program

Posted: Fri Jun 18, 2010 1:18 pm
by bayley60
thanks i made one and it works great but only if i could put a hot key for it like when its minimized i could press f9 and it would capture the screen.

Re: Make a screen Capture Program

Posted: Fri Jun 18, 2010 2:40 pm
by mandai
This thread has info on adding support for hotkeys: viewtopic.php?f=53&t=1138