TransparentBlt
The TransparentBlt function performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context.
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
);
使用起来也挺方便,如下
二、下面模拟TransparentBlt的实现过程,探究下底层实现, 整个实现过程的思想如下图所示,
代码如下:
参考:
http://www.programgo.com/article/20281711249/
https://wenku.baidu.com/view/bd80a841be1e650e52ea9981.html