如何减少 vb2005 面板中的闪烁?在父面板中,我正在使用另外 2 个面板。
最外面的面板包含一个背景精灵,两个最里面的面板是叠加层,它们会改变以适应背景精灵中的位置。
当我更改覆盖精灵时,我想减少闪烁并使其从一个精灵平滑过渡到下一个精灵。
这是更改覆盖面板中图像的代码,如果新值与旧值相同,则覆盖面板不会更改
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