Saturday, September 7, 2013

Assigning a timestamp to a taken screenshot

Assigning a timestamp to a taken screenshot

I'm new to VB, and I'm having some trouble. I created a button to
screenshot the window when pressed, however I want each screenshot to have
its own timestamp, so they don't keep overwriting each other. This is the
code I have now:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) _
Handles Button1.Click
Dim SC As New ScreenShot.ScreenCapture
Dim MyWindow As Image = SC.CaptureWindow(Me.Handle)
SC.CaptureWindowToFile(Me.Handle, "c:\temp\image.jpg",
Imaging.ImageFormat.Jpeg)
End Sub
I'm using this custom class: http://pastebin.com/9at7uESY
How would I have to edit either the class or the code to enable me to
timestamp each screenshot taken? Thanks!

No comments:

Post a Comment