I am trying to refresh PictureBox ImageLocation. Right now this works, but I would like images that are in "landscape" mode to show up landscape in my form. I can make that possible by using image.RotateFlip() and using a load beforehand.
But when I try to refresh the picture (using a timer control and another function to grab the screenshot using adb), it doesn't like to refresh. Using breakpoints shows that it continues to refresh. even when I add other items such as refresh, update, image = nothing.. it still does not refresh or clear the image.
Is Timer or Load the culprit?
Delegate Sub SetPicCallback([text] As String, ByVal [X] As Integer, ByVal [Y] As Integer, [label] As PictureBox)
Public Sub SetPic(ByVal [text] As String, ByVal [X] As Integer, ByVal [Y] As Integer, ByVal [label] As PictureBox)
' InvokeRequired required compares the thread ID of the
' calling thread to the thread ID of the creating thread.
' If these threads are different, it returns true.
If [label] IsNot Nothing Then
For Each ctrl As PictureBox In myPics
If ctrl.Name = [label].Name Then
If ctrl.InvokeRequired Then
Dim d As New SetPicCallback(AddressOf SetPic)
Me.Invoke(d, New Object() {[text], [X], [Y], [label]})
Else
With ctrl
.Width = [X] / 4
.Height = [Y] / 4
.Image = Nothing
.ImageLocation = [text]
'.Load([text])
'If [X] > [Y] Then
' .Image.RotateFlip(RotateFlipType.Rotate270FlipNone)
'End If
End With
End If
End If
Next
End If
End Sub