【发布时间】:2010-10-23 18:53:04
【问题描述】:
如何减少 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
【问题讨论】: