Olá Rodrigo
estou com o código aqui, o código que irei colocar agora, ele tira foto do desktop do seu computador e depois salva na unidade C: com numeros aleatórios.
'Neste código eu uso um TIMER e um PICTUREBOX
'Veja abaixo:
Private Declare Sub keybd_event Lib "user32" _
(ByVal bVk As Byte, ByVal bScan As _
Byte, ByVal dwFlags As Long, ByVal _
dwExtraInfo As Long)
Private Sub Timer1_Timer()
On Error GoTo erros
Timer1.Enabled = False
Dim PauseTime, Start, Finish, TotalTime
PauseTime = 60 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents ' Yield to other processes.
Loop
PauseTime = 60 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents ' Yield to other processes.
Loop
'P/ capturar a tela:
Picture1.AutoSize = True
keybd_event vbKeySnapshot, 1, 0&, 0&
DoEvents
Picture1.Picture = Clipboard.GetData(vbCFBitmap)
'P/ salvar a imagem:
SavePicture Picture1.Image, "C:" & Timer & ".jpg"
Timer1.Enabled = True
Timer1.Interval = 1
Exit Sub
erros:
Timer1.Enabled = True
Timer1.Interval = 1
End Sub