AlphaBlend

来源:互联网 发布:淘宝店铺装修素菜 编辑:程序博客网 时间:2024/05/17 01:06

BLENDFUNCTION.SourceConstantAlpha:如果设置为 255 的话就是原始效果


hdc = BeginPaint(hWnd, &ps);PAINTSTRUCT ps;HDC hBitmapDC = CreateCompatibleDC(hdc);SelectObject(hBitmapDC,hBitmap);BLENDFUNCTION bf;bf.BlendOp = AC_SRC_OVER;bf.BlendFlags = 0;  bf.AlphaFormat = 0;bf.SourceConstantAlpha = 75; //如果设置为 255 的话就是原始效果BITMAP bmp;GetObject(hBitmap, sizeof(BITMAP),&bmp);AlphaBlend(hdc,0,0,bmp.bmWidth,bmp.bmHeight,hBitmapDC,0,0,bmp.bmWidth,bmp.bmHeight,bf);DeleteObject(hBitmap);DeleteDC( hBitmapDC );EndPaint(hWnd, &ps);



0 0
原创粉丝点击