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. Urgent - need to fix control refresh flicker.

Urgent - need to fix control refresh flicker.

Scheduled Pinned Locked Moved C / C++ / MFC
helpsysadminperformanceannouncement
2 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.
  • G Offline
    G Offline
    Graham
    wrote on last edited by
    #1

    Hi, --> I cannot use memory DC to fix this - I don't have enough time to implement a complicated solution I was looking for a *simple* (refresh ordering) solution.. I have been implementing a sound effects proccessing program for my degree. The program makes use of controls as effect instances. There are also frame controls which provide a border for each instance and a single "Network Area" control that defines the region where effects can be placed. Each of these controls is a CStatic Picture control. Connections between modules are drawn using DC commands. My problem:- When the user moves an effects module I have to update the module position. I then redraw the Network control and then redraw the connections on top directly to the DC. This all works fine but causes an extreme amount of flicker in the effect module controls (these are positioned within the refreshed area) and their frames. I think it is to do with this - when the Network area is refreshed all controls within that region are refreshed again causeng the flicker. I have seen a solution to use ValidateRect but I don't know if this applies in my case (and I can't seem to get it to work anyhow) ! Please could someone tell me where I am going wrong as I am fairly new to windows programming.. Thanks.

    C 1 Reply Last reply
    0
    • G Graham

      Hi, --> I cannot use memory DC to fix this - I don't have enough time to implement a complicated solution I was looking for a *simple* (refresh ordering) solution.. I have been implementing a sound effects proccessing program for my degree. The program makes use of controls as effect instances. There are also frame controls which provide a border for each instance and a single "Network Area" control that defines the region where effects can be placed. Each of these controls is a CStatic Picture control. Connections between modules are drawn using DC commands. My problem:- When the user moves an effects module I have to update the module position. I then redraw the Network control and then redraw the connections on top directly to the DC. This all works fine but causes an extreme amount of flicker in the effect module controls (these are positioned within the refreshed area) and their frames. I think it is to do with this - when the Network area is refreshed all controls within that region are refreshed again causeng the flicker. I have seen a solution to use ValidateRect but I don't know if this applies in my case (and I can't seem to get it to work anyhow) ! Please could someone tell me where I am going wrong as I am fairly new to windows programming.. Thanks.

      C Offline
      C Offline
      Cristi Posea
      wrote on last edited by
      #2

      You can try to set WS_CLIPCHILDREN to the parent window. This will not invalidate the child windows when drawing/invalidate the parent client area, but you still will have flicker when drawing the connections. If you want to get rid of the later too, then the memdc solution is simpler (!)

      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