How do i reduce flicker in a vb2005 panel? Inside the parent panel i have 2 other panels that im am using.
The outer most panel contains a background sprite and the two innermost panels are overlays that change to fit the places in the background sprite.
When i change the overlay sprites i would like to reduce the flicker and make it a smooth transition from one sprite to the next.
here is the code that changes the images in the overlay panels the overlay panel is not changed if the new value is the same as the old value
Private Sub TrackBar2_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar2.Scroll, TrackBar1.Scroll
If (Panel2.Tag <> TrackBar1.Value) Then
Panel2.Tag = TrackBar1.Value
Panel2.BackgroundImage = tops(TrackBar1.Value) //img array for the top panel
Panel2.Update()
End If
If (Panel3.Tag <> TrackBar2.Value) Then
Panel3.Tag = TrackBar2.Value
If (TrackBar2.Value > 0) Then
Panel3.Location = New Point(182, 210)
Else
Panel3.Location = New Point(182, 209)
End If
Panel3.BackgroundImage = bottoms(TrackBar2.Value)//img array for the bottom panel
Panel3.Update()
End If