problem a, own drawing background is hiding the interface on the original control, in order to solve this problem, but get me hanging silk maxed out.
a, painted a background, and then the area of access to all controls, make it invalid. So the problem was solved, but a new problem came, is the flash screen problem. This problem is caused by overwriting the background and control color. In other words, this scheme is eunuch.
> For this kind of scheme, I just thought, should be OK. But it’s too difficult. I don’t have the ability to do it.
> Set the dialog’s clipChildren property to true. When you draw a window, you cut out the area of the control and copy it back when it is finished. This property is customized for the drawing, so the above problem is solved with just one click. The solution turned out to be so simple.
if draw refresh frequently, this there is no doubt that the splash screen will appear.
Scheme 1, the use of double buffer, no pressure. So every time I draw it, I just paste it on.
2, in painting background brush set for NULL_BRUSH background before you leave. The system could not draw.
3, to draw the background of function (OnEraseBkgnd (pDC) CDC *) content to watch out, with the return true replacement, and then system, there is no way to use the default brush to draw the background. However, the latter two methods solve the flicker, but the interface can be a mess.
using GDI resource summary:
first of all, we all know this law have borrow have also, so when learning c + + so follow this rule, otherwise you will hit a wall.
when using handle with H, for example: the HBITMAP etc, after using DeleteObject remember;
For GDI wrapped classes with C, this is not necessary because the system has already freed them during object destructing. If you leave the system resource handle with the class Detach, then you need to take over the management of the system resource, otherwise the system resource leak will occur.
when using CDC, if the memory DC created after running out also need DeleteDc…..
Read More:
- Solution of flash screen caused by OpenGL in MFC environment
- GPU hardware acceleration related problems, solve flash screen
- Vs2013 error msb8031 solution today ran a MFC program, found that the error: error msb8031: building an MFC project for a non-U
- Why does the result screen flash when visual studio runs the program?
- Solution of OpenGL window flicker in MFC framework
- The solution of flicker and no refresh caused by OpenGL + MFC
- Solution of no response of progress bar in MFC program
- OpenGL result white screen solution
- The solution of white screen crash when loading QML
- VS2010 debugging window flash solution
- Solution for flash back of vs2015 running interface
- Windows solution enabled visdom.server Slow and blank blue screen (no navigation bar)
- The solution of default boot device missing or boot failed appears on the blue screen of Lenovo xiaoxinchao 7000
- The solution to the flash of. Bat file
- The solution of console flash in C + +
- The perfect solution of VS2010 console program running in a flash
- Problem solving – vs debugging window flash solution
- Solution to the problem of console flash in vs2017 runtime
- The solution to the black window flash of running program on Visual Studio
- Visual studio 2015 compiler, console flash solution