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 / C++ / MFC
  4. Flickering Problem

Flickering Problem

Scheduled Pinned Locked Moved C / C++ / MFC
graphicshelptutorialquestion
5 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.
  • M Offline
    M Offline
    mcsherry
    wrote on last edited by
    #1

    I a CDialog based application which has approx 30 CBitmapButtons and 30 CStatic text boxes. I'm receiving data at about 20hz which is causing the screen to flicker badly when these are getting repopulated. I've looked at the usual ways of stopping/reducing the flicker (overloading OnEraseBkgnd, using InvalidateRect ( rect, FALSE ), Invalidate (FALSE), etc...) with no luck. Does anyone have any ideas how I can overcome this? One idea I've had is buffering the entire dialog before painting it, however I can only find examples on how to do this with bitmap controls rather than an entire dialog with controls. TIA, Andy

    M 1 Reply Last reply
    0
    • M mcsherry

      I a CDialog based application which has approx 30 CBitmapButtons and 30 CStatic text boxes. I'm receiving data at about 20hz which is causing the screen to flicker badly when these are getting repopulated. I've looked at the usual ways of stopping/reducing the flicker (overloading OnEraseBkgnd, using InvalidateRect ( rect, FALSE ), Invalidate (FALSE), etc...) with no luck. Does anyone have any ideas how I can overcome this? One idea I've had is buffering the entire dialog before painting it, however I can only find examples on how to do this with bitmap controls rather than an entire dialog with controls. TIA, Andy

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      I would look into updating the controls without redrawing the entire dialog (especially its background) every time data is updated. Also limiting the update region(s) to just areas that change helps alot. Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      M 1 Reply Last reply
      0
      • M Mark Salsbery

        I would look into updating the controls without redrawing the entire dialog (especially its background) every time data is updated. Also limiting the update region(s) to just areas that change helps alot. Mark

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        M Offline
        M Offline
        mcsherry
        wrote on last edited by
        #3

        Hi Thanks for your reply. I've delved further into this now and have found that the flickering is due (or at least appears to be due) to the fact that I have controls on top of each other, an example is that I will have a Group Box with a CEdit control inside of it, when they are seperate they don't flicker when combined they do. I'm using the Group box to provide a border effect to the CEdit control as none of the built in border styles are suitable, so if I can get an identicle border in another way then my problem may be sorted! Do you have any ideas on how to do this? cheers, Andy

        M 1 Reply Last reply
        0
        • M mcsherry

          Hi Thanks for your reply. I've delved further into this now and have found that the flickering is due (or at least appears to be due) to the fact that I have controls on top of each other, an example is that I will have a Group Box with a CEdit control inside of it, when they are seperate they don't flicker when combined they do. I'm using the Group box to provide a border effect to the CEdit control as none of the built in border styles are suitable, so if I can get an identicle border in another way then my problem may be sorted! Do you have any ideas on how to do this? cheers, Andy

          M Offline
          M Offline
          mcsherry
          wrote on last edited by
          #4

          well sort of the answer, further to my above post, I've got rid of the group boxes and changed the style of the CEdit controls to have the Border, Modal Frame and Static Edge set to TRUE. Although this border is thicker than I wanted it is better to look at than a flickering screen! Any suggestions on how to make this border thinner would be great :) Andy,

          M 1 Reply Last reply
          0
          • M mcsherry

            well sort of the answer, further to my above post, I've got rid of the group boxes and changed the style of the CEdit controls to have the Border, Modal Frame and Static Edge set to TRUE. Although this border is thicker than I wanted it is better to look at than a flickering screen! Any suggestions on how to make this border thinner would be great :) Andy,

            M Offline
            M Offline
            Mark Salsbery
            wrote on last edited by
            #5

            mcsherry wrote:

            Any suggestions...

            No :) I'm still wondering why the groupbox causes flicker.  Is it just a Z-order thing? If you set the tab order, the groupbox should be before any controls "inside" it. Mark

            Mark Salsbery Microsoft MVP - Visual C++ :java:

            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