VB 2008 Tutorial - Screen Capture

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
3 posts Page 1 of 1
Contributors
User avatar
tvs praveen
Top Poster
Top Poster
Posts: 205
Joined: Tue Dec 08, 2009 6:20 am

Add 1 PictureBox, 2 Buttons and 1 OpenFileDialog ;)

Rename a Button1 text into Capture Screen, Rename Button2 text into Save Image

Double click and insert this code into Button1
Code: Select all
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
Double click and insert this code into Button2
Code: Select all
Dim savefiledialog1 As New SaveFileDialog
Try
savefiledialog1.Title = "Save Captured Image"
savefiledialog1.FileName = "Screenshot Image 1"
savefiledialog1.Filter = "All Type Of Image Files|*.*|Joint Photographic Experts Group [JPEG]|*.jpg|Bitmap [BMP|*.bmp|Tagged Image File Format [TIFF]|*.tiff|Portable Network Graphics [PNG]|*.png"
If savefiledialog1.ShowDialog() = DialogResult.OK Then
PictureBox1.Image.Save(savefiledialog1.FileName, System.Drawing.Imaging.ImageFormat.Bmp)
End If
Catch ex As Exception
End Try

*******************Thanks for reading my tutorial, I think this Tutorial will be most helpful to you!*******************

If you want any custom tutorial for you or you need any help in VS.NET, VB.NET, Software Coding, Designing and much more any help in Computer stuffs just ask me

Mostly i will help everyone in coding and design stuffs in on Computer

- Best regards hehaho;

- Tvs Praveen wahooo;

- Thanks CodeNStuff! for this amazing Website cooll;
Last edited by tvs praveen on Wed Jan 06, 2010 6:30 am, edited 4 times in total.
User avatar
Coi
Just Registered
Just Registered
Posts: 4
Joined: Wed Dec 16, 2009 11:35 pm

Re: VB 2008 Tutorial - Screen Capture
Coi
Nice tutorial, but I would like to be able to save it as video.
User avatar
Nery
Co-Admin Moderator
Co-Admin Moderator
Posts: 1117
Joined: Mon Sep 07, 2009 8:11 pm

Re: VB 2008 Tutorial - Screen Capture
Nery
------------------Thanks for Watching Video!, I think this Tutorial i`ll be most helpful to you!, Best regards, Tvs Praveen----------------------------
There is no video...
3 posts Page 1 of 1
Return to “Tutorials”