Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Could somebody help me I am trying to make a Visual Basic program that is able t

ID: 3810397 • Letter: C

Question

Could somebody help me I am trying to make a Visual Basic program that is able to take screen shots of the whole computer screen and then compress them down into a zip file. So what I am looking for is basically having one button to take a screen shot (preferably shrinking the program when taking one and then minimizing it after it has taken the screen shot) and then once the user is finished taking their screen shots there would be another button that would let them zip all of those screenshots into a zip file.

Explanation / Answer

First method .. button click will handle to save screen shot as j[eg files. Finally after taking all screen shots, call 'SaveAsZip()' method, which converts all images into zip and place it in parent folder.

Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
'gettting the whole screen area
Dim presentCurr_Screen = Screen.FromHandle(Me.Handle).WorkingArea

'for current screen create bit map
Using curr_bmp As New Bitmap(presentCurr_Screen.Width, presentCurr_Screen.Height)

'screen copying...
Using grphcs = Graphics.FromImage(curr_bmp)
grphcs.CopyFromScreen(New Point(0, 0), New Point(0, 0), presentCurr_Screen.Size)
End Using

'saving screen shot capture
curr_bmp.Save("C:UsersusernameDocuments est.Jpeg", Imaging.ImageFormat.Jpeg)
End Using
End Using
End Sub
Private Function SaveAsZip()
   Dim directory_info As New DirectoryInfo(C:UsersusernameDocuments)
Dim zip_file_name As String = directory_info.FullName & ".zip"

Using comp_folder As New CompressedFolder(zip_file_name)
comp_folder.CompressFile(directory_info.FullName)
End Using
End Function