![]() |
|
HOW TO MAKE A SCREEN CAPTURER IN VB.NET - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Coding (https://sinister.li/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.li/Forum-Visual-Basic-NET-Framework) +--- Thread: HOW TO MAKE A SCREEN CAPTURER IN VB.NET (/Thread-HOW-TO-MAKE-A-SCREEN-CAPTURER-IN-VB-NET) |
HOW TO MAKE A SCREEN CAPTURER IN VB.NET - -1CE- - 01-21-2013 TODAY I WILL BE TEACHING YOU ON HOW TO MAKE YOUR OWN SCREEN CAPTURER FOR FUTURE USE IN VB.NET LETS START: FIRST OF ALL SET UP A FORM: 1 PICTUREBOX 3 BUTTONS 1 SAVEFILEDIALOG SET UP THE FORM AS IN BELOW: ![]() FOR THE FORM: ! 1)DISABLE MAXIMIZE ABILITY IN IT PROPERTIES. OK NOW LETS CODING CLICK THE "CAPTURE SCREEN" BUTTON AND ENTER THIS CODE: Code: Opacity = 0
Dim Bounds As Rectangle
Dim Capture As System.Drawing.Bitmap
Dim Graph As Graphics
Bounds = Screen.PrimaryScreen.Bounds
Capture = New System.Drawing.Bitmap(Bounds.Width, Bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppPArgb)
Graph = Graphics.FromImage(Capture)
Graph.CopyFromScreen(Bounds.X, Bounds.Y, 0, 0, Bounds.Size, CopyPixelOperation.SourceCopy)
PictureBox1.Image = Capture
Opacity = 100NOW CLICK THE "SAVE" BUTTON AND ENTER THIS CODE: Code: Dim pic As Image
SaveFileDialog1.DefaultExt = "*.bmp"
SaveFileDialog1.Filter = "Bmp Files|*.bmp"
pic = PictureBox1.Image
SaveFileDialog1.ShowDialog()
On Error Resume Next
pic.Save(SaveFileDialog1.FileName)NOW CLICK THE "EXIT" BUTTON AND ENTER THIS CODE: Code: ENDRE: HOW TO MAKE A SCREEN CAPTURER IN VB.NET - Coder-san - 01-21-2013 Sorry, you didn't teach anything at all. You just gave the code to copy and paste. There aren't even comments in the code, and it's too sloppy. You look like in a hurry. I'll point out some stuff:-
RE: HOW TO MAKE A SCREEN CAPTURER IN VB.NET - ArkPhaze - 01-23-2013 Code: Dim Graph As GraphicsGraph as, Graphics? :unsure: The naming conventions here are horrible. Nothing wrong with declaring Bitmap over and over in my opinion... The bad, is that if you're going to do that, you should be disposing of the resources... If you go Coder-San's way, then you only have one instance to deal with. So if you're too lazy to clean up after yourself, that's a quick solution. RE: HOW TO MAKE A SCREEN CAPTURER IN VB.NET - Coder-san - 01-23-2013 It won't make much difference in basic use of graphics like here, but if you, lets say, are making a Zoom function in a pictureviewer the memory usage will be astonishing. RE: HOW TO MAKE A SCREEN CAPTURER IN VB.NET - Acid - 01-27-2013 nice, just finished mine the other day with GUI polished. RE: HOW TO MAKE A SCREEN CAPTURER IN VB.NET - DaniMajo - 02-07-2013 thanx for sharing i like it >>>>>>>> RE: HOW TO MAKE A SCREEN CAPTURER IN VB.NET - Rocky Ajwani - 02-07-2013 thnx i'm gonna impress my teacher with this simple trick Thanks for sharing man
|