我想在程序初始化的时候就把位图作成透明的,不希望每次使用的时候在做透明处理。
因该怎么做,最好有具体的例子,谢谢!!!

解决方案 »

  1.   

    如果用GDI,加载了位图之后,根据位图创建一个CRgn,以后每次在画这个位图之前把这个CRgn选入DC。
    如果用GDI+,把这张位图做成PNG,该透明的地方做透明,然后就可以直接用了,DrawImage直接就可以画透明图片
      

  2.   

    colorkey,BOOL TransparentBlt(
      HDC hdcDest,        // handle to destination DC
      int nXOriginDest,   // x-coord of destination upper-left corner
      int nYOriginDest,   // y-coord of destination upper-left corner
      int nWidthDest,     // width of destination rectangle
      int hHeightDest,    // height of destination rectangle
      HDC hdcSrc,         // handle to source DC
      int nXOriginSrc,    // x-coord of source upper-left corner
      int nYOriginSrc,    // y-coord of source upper-left corner
      int nWidthSrc,      // width of source rectangle
      int nHeightSrc,     // height of source rectangle
      UINT crTransparent  // color to make transparent
    );
      

  3.   

    高手已经写得很具体了啊。楼主连msdn都不肯查一下么
      

  4.   

    如果楼主实在不想代码处理就让美工作成png图片,让其透明。