|
项目描述: |
Ok. Every window has a Region. This is how Windows knows what area of the screen to draw on when something changes in your program. Normally a windows Region is square, but you can make one that is non-square (basically any shape you want) so that Windows will only draw the part of your window that is within the non-square Region. What I have done is scan through the window pixel by pixel looking for the color I want to make transparent. Everytime I find that color, I add it to a temporary Region. I collect all the transparent spaces, then invert it and assign it to the window. The CRgn class, as it turns out, it a very powerful little class.
每个窗口都有一个区域。这就是Windows知道当应用程序变化时应该在屏幕的什么地方绘制窗口。通常一个Windows区域是矩形的,但可以生成非矩形窗口(基本上可以是任意窗口),这样Windows将只绘制非矩形区域中的一部分。我所希望的是按像素扫描窗口以查找需要设置为透明的颜色。一旦找到这一颜色,我将相应的像素增加到一个临时区域中。我收集所有的透明区域,反转它,并将它分配给窗口。CRgn 是一个功能强大的类。
来源: http://www.codeguru.com/dialog/transparent_dialog.shtml |
类别: |
|
发布者:
cbd002
|
|
最新发布源码包 |
软件包 |
版本号 |
日期 |
本地下载 |
transparent_dialog |
 1.0  |
2004-04-09 |
下载 |
|
|