窗口半透明

来源:互联网 发布:学历制作软件 编辑:程序博客网 时间:2024/05/17 00:09

BOOL   AlphaBlend(  
      HDC   hdcDest,                                   //   handle   to   destination   DC  
      int   nXOriginDest,                         //   x-coord   of   upper-left   corner  
      int   nYOriginDest,                         //   y-coord   of   upper-left   corner  
      int   nWidthDest,                             //   destination   width  
      int   nHeightDest,                           //   destination   height  
      HDC   hdcSrc,                                     //   handle   to   source   DC  
      int   nXOriginSrc,                           //   x-coord   of   upper-left   corner  
      int   nYOriginSrc,                           //   y-coord   of   upper-left   corner  
      int   nWidthSrc,                               //   source   width  
      int   nHeightSrc,                             //   source   height  
      BLENDFUNCTION   blendFunction     //   alpha-blending   function  
  );  
最后一个值的上限是255,你想透明减小这个值就可以了.  
   
  注意这个函数需要MSIMG32.LIB,你需要在工程里加上