基本结构:
typedef struct _BLENDFUNCTION {
BYTE BlendOp;
BYTE BlendFlags;
BYTE SourceConstantAlpha;
BYTE AlphaFormat;
}BLENDFUNCTION, *PBLENDFUNCTION, *LPBLENDFUNCTION;
This structure controls blending by specifyingthe blending functionsfor source and destination bitmaps.
这里的the blending functions指的是哪些函数?
我所知道的有一个:
BOOL UpdateLayeredWindow( HWND hwnd, HDC hdcDst, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc, COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags );其中的hdcDst和hdcSrc就是source and destination bitmaps。
——————————————————————————————
Specifies the source blend operation. Currently, the only source and destination blend operationthat has been defined is AC_SRC_OVER.
目前只有一种混合模式,就是AC_SRC_OVER。
Specifies an alpha transparency value to be used on the entire source bitmap. TheSourceConstantAlphavalue is combined with any per-pixel alpha values in the source bitmap. If you setSourceConstantAlphato 0, it is assumed that your image is transparent. When you only want to use per-pixel alpha values, set theSourceConstantAlphavalue to 255 (opaque) .
这个参数设定的是源图像将以什么不透明度叠加在目标图像上。0则透明,255则不透明。
This member controls the way the source and destination bitmaps are interpreted.
AC_SRC_ALPHA:
This flag is set when the bitmap has an Alpha channel (that is, per-pixel alpha). Because this API uses premultiplied alpha, the red, green and blue channel values in the bitmap must be premultiplied with the alpha channel value. For example, if the alpha channel value is x, the red, green and blue channels must be multiplied by x and divided by 0xff before the call.
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-26788-1.html
信不信由你
说明人家还是看不起我们