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