Flicker with transparent labels on different panels
-
I have a Form with a Panel mainBackPanel. To mainBackPanel I add different panels say redPanel, greenPanel, bluePanel depending on key pressed, r, g, b respectively. Each panel has a different image (say tomatoes, trees, sky) and a transparent label. Now when the panel changes, I see a small flicker on the area covered by the label. mainBackPanel (to which the individual panels are added) is double buffered. The code, in .NET 2.0, can be found here[^]. You will need to put 3 image files namely fb.jpg, mf.jpg and pl.jpg in bin/debug folder prior to running the app. Please suggest how to get rid of the flicker. Thanks Sukhjinder
Looking for help on my OpenSource Media Player LetsYo
-
I have a Form with a Panel mainBackPanel. To mainBackPanel I add different panels say redPanel, greenPanel, bluePanel depending on key pressed, r, g, b respectively. Each panel has a different image (say tomatoes, trees, sky) and a transparent label. Now when the panel changes, I see a small flicker on the area covered by the label. mainBackPanel (to which the individual panels are added) is double buffered. The code, in .NET 2.0, can be found here[^]. You will need to put 3 image files namely fb.jpg, mf.jpg and pl.jpg in bin/debug folder prior to running the app. Please suggest how to get rid of the flicker. Thanks Sukhjinder
Looking for help on my OpenSource Media Player LetsYo
-
Before you do any processing on the images, use SuspendLayout[^] and when you're done use ResumeLayout.
He who makes a beast out of himself gets rid of the pain of being a man
All KeyEvents are being handled by MainForm in the following method
void mainFormKeyUpHandler(Object o, KeyEventArgs kev) { if( kev.KeyCode == Keys.R ) { this.mainBackPanel.Controls.Clear(); this.mainBackPanel.SuspendLayout(); this.mainBackPanel.Controls.Add(this.mainFormPanel); this.mainBackPanel.ResumeLayout(); } else . . . } `But the result is still the same. Looking for help on my OpenSource Media Player [LetsYo](http://sukhjinder.cn/letsyo/contribute.html) `
-
All KeyEvents are being handled by MainForm in the following method
void mainFormKeyUpHandler(Object o, KeyEventArgs kev) { if( kev.KeyCode == Keys.R ) { this.mainBackPanel.Controls.Clear(); this.mainBackPanel.SuspendLayout(); this.mainBackPanel.Controls.Add(this.mainFormPanel); this.mainBackPanel.ResumeLayout(); } else . . . } `But the result is still the same. Looking for help on my OpenSource Media Player [LetsYo](http://sukhjinder.cn/letsyo/contribute.html) `
-
Move that suspend before Controls.Clear() as that may also cause some flickering. Might solve it for you.
He who makes a beast out of himself gets rid of the pain of being a man
Tried that too. It doesn't work.
Looking for help on my OpenSource Media Player LetsYo
-
Tried that too. It doesn't work.
Looking for help on my OpenSource Media Player LetsYo
I searched the web and found many people having similar problems. Typical scene is you remove a control and add a new one. This causes a flicker. I searched the Internet and found some potential solutions but couldn't understand them much. Can you help me with it? Solution #1[^] Solution #2[^] Solution #3[^]
Looking for help on my OpenSource Media Player LetsYo