vb2005 パネルのちらつきを減らすにはどうすればよいですか? 親パネル内には、使用している他の 2 つのパネルがあります。
最も外側のパネルには背景スプライトが含まれ、最も内側の 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