[RESOLVED] Screenshot-Help me
I want to get the whole screen in image control and then save it to my folder.
Every thing is working fine except the image saved in the folder. Is there any problem in the following code? I also want that the image saved should be overwritten.
vb Code:
Private Sub Command1_Click()
Timer1.Enabled = True
Me.WindowState = vbMinimized
End Sub
Private Sub Timer1_Timer()
On Error GoTo errhandler
Label1.Caption = Val(Label1.Caption) + 1
For i = 1 To 10
Clipboard.Clear
keybd_event vbKeySnapshot, 0, 0, 0
DoEvents
Set Image1.Picture = Clipboard.GetData(vbCFBitmap)
SavePicture Image1.Picture, "C:\Documents and Settings\Vivek\My Documents\screenshots\image" & i & ".bmp"
Next i
errhandler:
MsgBox " completed"
Timer1.Enabled = False
End Sub
Re: Screenshot-Help me hack!
Please stop bumping your threads.
Re: Screenshot-Help me hack!
Are you still using
Code:
Set Image1.Picture = Clipboard.GetData(vbCFBitmap)
I just ran your code, with
Code:
Image1.Picture = Clipboard.GetData(vbCFBitmap)
for 25 pictures, with the form being minimized in the 3rd one, and it didn't throw an error.
Re: Screenshot-Help me hack!
Quote:
Originally Posted by Al42
Are you still using
Code:
Set Image1.Picture = Clipboard.GetData(vbCFBitmap)
I just ran your code, with
Code:
Image1.Picture = Clipboard.GetData(vbCFBitmap)
for 25 pictures, with the form being minimized in the 3rd one, and it didn't throw an error.
That's what I pointed out in post #21.
Re: Screenshot-Help me hack!
I tried both the method set and without set. then also it is displaying error?It will give error when i minizmize the project and click on another window.