Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Flicker with transparent labels on different panels

Flicker with transparent labels on different panels

Scheduled Pinned Locked Moved C#
csharphtmldebugginghelptutorial
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sukhjinder_K
    wrote on last edited by
    #1

    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

    P 1 Reply Last reply
    0
    • S Sukhjinder_K

      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

      P Offline
      P Offline
      phannon86
      wrote on last edited by
      #2

      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

      S 1 Reply Last reply
      0
      • P phannon86

        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

        S Offline
        S Offline
        Sukhjinder_K
        wrote on last edited by
        #3

        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) `

        P 1 Reply Last reply
        0
        • S Sukhjinder_K

          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) `

          P Offline
          P Offline
          phannon86
          wrote on last edited by
          #4

          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

          S 1 Reply Last reply
          0
          • P phannon86

            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

            S Offline
            S Offline
            Sukhjinder_K
            wrote on last edited by
            #5

            Tried that too. It doesn't work.

            Looking for help on my OpenSource Media Player LetsYo

            S 1 Reply Last reply
            0
            • S Sukhjinder_K

              Tried that too. It doesn't work.

              Looking for help on my OpenSource Media Player LetsYo

              S Offline
              S Offline
              Sukhjinder_K
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups