注意,不是半透明窗口。是一个普通窗口中画有一个矩形(或其他形状),要实现这个矩形(或其他形状)的半透明。

解决方案 »

  1.   

    居然能遇到个有意思的问题 
    int CDC::SetROP2( int nDrawMode );我以前做过例似的程序,好象是重绘一个列表框
    鼠标指向一项就马上出现一个半透明框上显示这一项的相关数据
    但用的哪个参数忘了,不同的参数效果也不同你自己试试
    下面几个最有可能反色
    R2_NOT   Pixel is the inverse of the screen color.
     
    画笔颜色与屏幕反色组合
    R2_MERGEPENNOT   Pixel is a combination of the pen color and the inverse of the screen color (final pixel = (NOT screen pixel) OR pen).画笔颜色与屏幕公共色组合
    R2_MASKPENNOT   Pixel is a combination of the colors common to both the pen and the inverse of the screen (final pixel = (NOT screen pixel) AND pen).屏幕颜色与画笔反色组合
    R2_MERGENOTPEN   Pixel is a combination of the screen color and the inverse of the pen color (final pixel = (NOT pen) OR screen pixel).屏幕颜色与画笔反色公共色组合
    R2_MASKNOTPEN   Pixel is a combination of the colors common to both the screen and the inverse of the pen (final pixel = (NOT pen) AND screen pixel).懒得写了,反正能套出来
    R2_MERGEPEN   Pixel is a combination of the pen color and the screen color (final pixel = pen OR screen pixel).
    R2_NOTMERGEPEN   Pixel is the inverse of the R2_MERGEPEN color (final pixel = NOT(pen OR screen pixel)).
    R2_MASKPEN   Pixel is a combination of the colors common to both the pen and the screen (final pixel = pen AND screen pixel).
    R2_NOTMASKPEN   Pixel is the inverse of the R2_MASKPEN color (final pixel = NOT(pen AND screen pixel)).
    R2_XORPEN   Pixel is a combination of the colors that are in the pen or in the screen, but not in both (final pixel = pen XOR screen pixel).
    R2_NOTXORPEN   Pixel is the inverse of the R2_XORPEN color (final pixel = NOT(pen XOR screen pixel)). 
      

  2.   

    简单到不能再简单的问题,使用
    AlphaBlend函数,你可以搜索一下csdn上的帖子,我以前回答过别人的
      

  3.   

    这篇文章里有介绍:(是 WinZip用压缩的)
    http://www.soft168.com/download/download1.asp?downid=1&id=1180
      

  4.   

    http://newnan.8u8.com/vcstudy/alphablend.txt
      

  5.   

    1. 用setwindowrgn给窗口挖个洞
    2. 创建一个半透明的窗口(如果不是矩形的话,用setwindowrgn把窗口的相应形状设好)
    3. 同步两个窗口的位置就差不多了,不过机器慢的话可能会见到半透明窗口的拖尾现象测试程序
    http://my.6to23.com/cigarette/a1.zip
      

  6.   

    用AlphaBlend函数就可以实现了!
    可以用www.google.com收索一下这方面的例子!
    有很多的!
    呵呵……