毕业论文开发语言企业开发JAVA技术.NET技术WEB开发Linux/Unix数据库技术Windows平台移动平台嵌入式论文范文英语论文
您现在的位置: 毕业论文 >> 嵌入式 >> 正文

mfc 对话框背景图片上static控件设置透明后直接透到桌面上了

更新时间:2014-5-29:  来源:毕业论文

mfc 对话框背景图片上static控件设置透明后,没有透明贴图直接透到到桌面,怎么解决
WinCE 下使用系统提供的控件,是不可能实现 LZ 想要的效果的。 WinCE 下使用系统提供的控件,是不可能实现 LZ 想要的效果的。 windows系统可以 wince系统中不行 我已经通过自绘控件解决了问题Introduction
I was writing a program on PPC 2002 and the program UI required a dialog with a bitmap image background. As I was designing the dialog in the eVC++ 3.0 dialog template editor, I added controls like static texts, group boxes and etc. I checked the transparent option in the property of each of the controls that I have added to the dialog. But on PPC 2002 the transparent option does not work like it does on PC Platform OSes. On CE, transparent windows behave as if they have WS_CLIPCHILDREN style set. You can see through the parent dialog window itself. Definately not the effect I was hoping for.

There is an article for making transparent static texts at http-//www.pocketpcdn-com/ and http-//www.pocketpcdn.com/articles/transparent_static-html.  It basically draws all of the static text in the WM_PAINT handler of the parent dialog procedure.  But if you have other controls such as group boxes, you will have to draw the group boxes yourself.

To solve this problem, I used the WM_CTLCOLORSTATIC message handler. I first created a pattern brush with the bitmap image to be used as the backround for the dialog window.  And in the WM_CTLCOLORSTATIC message handler in the dialog procedure, I returned the brush handle I created previously.  The downside to this method is that you'll have to create separate brushes for each of the controls that are to be transparent which means more memory usage.  But you get the desired effect.

License
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©youerw.com 优尔论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。