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




Reply With Quote