vb.net - Reducing flicker when you change images in a panel -


How do I reduce the flicker in the vb2005 panel? Inside the parent panel, I have 2 other panels I am using.

The outermost panel has a background phantom and there are two innermost panel overlays that fit in places of the background sprite. / P>

When I change the overlay sprites, then I want to reduce flicker and would like to make it a smooth transition from one phantom to another.

Here is the code that changes the images in the overlay, the panel overlay panel does not change if the new value is the same as the old value

  2_Scroll Private Bypass (ByVal Sender) System.Object, System.Object, ByVal e. such as. EventArgs) TrackBar2.Scroll handles are TrackBar1.Scroll (Panel2.Tag>> TrackBar1.Value) then Panel2.Tag = TrackBar1.Value Panel2.BackgroundImage = Most (TrackBar1.Value) // Top panel img array for panel2.Update () if finished (Panel3.Tag>> TrackBar2.Value) then panel 3.Tag = TrackBar2.Value if (TrackBar2. Value & gt; 0) then panel 3. position = New point (182, 210) other panel 3. location = new point (182, 20 9) end if panel 3. Background image = img array for bottom panel (TrackBar2.Value) // img array panel3.Update () end if  

You will not like this answer. Flicker is generated by the fact that the default. The NET panel is not a double buffer - so it does all the images directly in visible memory, not back buffer.

You need sub-classes of the panel square and enable double buffering on the new square. It can be done with a

  SetStyle  

by constructor in the constructor Customize double buffering and dub buffering enabled.

Once you have a new panel class that has been given double buffers, you can use them in your application instead of the standard panel.

I told you that you would not like the answer;)


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -