Background color
-
Anyone have an idea how to find the RGB value of the default MFC dialog. I am building a program and need to know what color the screen comes up as so that after I am done using the CDC->TextOut command, I can call it again with a font of the same color as the background. Please advise. Thank you.
-
Anyone have an idea how to find the RGB value of the default MFC dialog. I am building a program and need to know what color the screen comes up as so that after I am done using the CDC->TextOut command, I can call it again with a font of the same color as the background. Please advise. Thank you.
Well, I believe that the background color is GetSysColor(COLOR_3DFACE), as long as XP Visual Styles don't come into play -- they it could be anything, including a bitmap. You would be better served to just call dc->SetBkMode(TRANSPARENT) and just draw transparent text.
-
Well, I believe that the background color is GetSysColor(COLOR_3DFACE), as long as XP Visual Styles don't come into play -- they it could be anything, including a bitmap. You would be better served to just call dc->SetBkMode(TRANSPARENT) and just draw transparent text.
:)I was using the SetBkMode(Transparent) call, but I wanted to be able to find the color of the background so that I could clean up the screen by simply calling the same TextOut function, but with the background color to effectively "mask" away the text I already painted. The GetSysColor function seems to be working. Thanks for the information.
-
Anyone have an idea how to find the RGB value of the default MFC dialog. I am building a program and need to know what color the screen comes up as so that after I am done using the CDC->TextOut command, I can call it again with a font of the same color as the background. Please advise. Thank you.
See
GetBkColor(GetDC()->m_hDC)
_**
**_
whitesky