WINCE下的BLENDFUNCTION

很奇怪, 在WINCE6的模拟器下,如果使用AlphaBlend,则BLENDFUNCTION的AlphaFormat必须设置为零才有效, 而MSDN里的定义是只有AC_SRC_ALPHA. 真矛盾.

 

BLENDFUNCTION

This structure controls blending by specifying the blending functions for source and destination bitmaps.

typedef struct _BLENDFUNCTION {
  BYTE  BlendOp;
  BYTE  BlendFlags;
  BYTE  SourceConstantAlpha;
  BYTE  AlphaFormat;
}BLENDFUNCTION, *PBLENDFUNCTION, *LPBLENDFUNCTION;

Members

BlendOp
Specifies the source blend operation. Currently, the only source and destination blend operation that has been defined is AC_SRC_OVER. For details, see the following Remarks section.
BlendFlags
Must be zero.
SourceConstantAlpha
Specifies an alpha transparency value to be used on the entire source bitmap. The SourceConstantAlpha value is combined with any per-pixel alpha values in the source bitmap. If you set SourceConstantAlpha to 0, it is assumed that your image is transparent. When you only want to use per-pixel alpha values, set the SourceConstantAlpha value to 255 (opaque) .
AlphaFormat
This member controls the way the source and destination bitmaps are interpreted. The following table shows the value for AlphaFormat.
Value Description
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.
 

你可能感兴趣的:(Microsoft,header,byte,Blend,WinCE,structure)