A
AAaron123
Is the following OK in Backgroundworker:
Private Sub backgroundWorker1_DoWork(ByVal sender As Object, ByVal e As
DoWorkEventArgs) Handles backgroundWorker1.DoWork
Static index As Integer = 700
Dim filename As String
filename = "Image_" & index.ToString("D4")
'NOTE THE CONTROL WebBrowser1 IS USED
Dim bmp As Drawing.Bitmap = SomeMethod(WebBrowser1.Handle)
bmp.Save("C:\SiteShow\" & filename & ".bmp",
System.Drawing.Imaging.ImageFormat.Bmp)
index += 1
End Sub
or do I need to call something like this.
Private Sub SetText(ByVal [text] As String)
If Me.textBox1.InvokeRequired Then
Dim d As New SetTextCallback(AddressOf SetText)
Me.Invoke(d, New Object() {[text]})
Else
Me.textBox1.Text = [text]
End If
End Sub
although it's not clear to me how to adapt the above!
if I want to do it repeatedly can I in a Timer click event do:
Private Sub Timer1_Tick(...) Handles Timer1.Tick
If Me.backgroundWorker1.IsBusy Then
Exit Sub
Else
Me.backgroundWorker1.RunWorkerAsync()
End If
End Sub
Thanks for any help at all
Private Sub backgroundWorker1_DoWork(ByVal sender As Object, ByVal e As
DoWorkEventArgs) Handles backgroundWorker1.DoWork
Static index As Integer = 700
Dim filename As String
filename = "Image_" & index.ToString("D4")
'NOTE THE CONTROL WebBrowser1 IS USED
Dim bmp As Drawing.Bitmap = SomeMethod(WebBrowser1.Handle)
bmp.Save("C:\SiteShow\" & filename & ".bmp",
System.Drawing.Imaging.ImageFormat.Bmp)
index += 1
End Sub
or do I need to call something like this.
Private Sub SetText(ByVal [text] As String)
If Me.textBox1.InvokeRequired Then
Dim d As New SetTextCallback(AddressOf SetText)
Me.Invoke(d, New Object() {[text]})
Else
Me.textBox1.Text = [text]
End If
End Sub
although it's not clear to me how to adapt the above!
if I want to do it repeatedly can I in a Timer click event do:
Private Sub Timer1_Tick(...) Handles Timer1.Tick
If Me.backgroundWorker1.IsBusy Then
Exit Sub
Else
Me.backgroundWorker1.RunWorkerAsync()
End If
End Sub
Thanks for any help at all