AlphaBlend 函数(Platform SDK)

AlphaBlend

[此为初始的文档,可能有变更.]

AlphaBlend函数能显示透明或者半透明效果的位图.

AlphaBlend(
  HDC hdcDest,
  int nXOriginDest,
  int nYOriginDest,
  int nWidthDest,
  int hHeightDest,
  HDC hdcSrc,
  int nXOriginSrc,
  int nYOriginSrc,
  int nWidthSrc,
  int nHeightSrc,
  BLENDFUNCTION blendFunction
);
 
参数:
hdcDest
目标设备场景(device context)句柄. (*注:E文能力有限,请参阅hDC. )
nXOriginDest
指定目标矩形的左上角的X坐标,逻辑单位.
nYOriginDest
指定目标矩形的左上角的Y坐标,逻辑单位.
nWidthDest
指定目标矩形的宽度,逻辑单位.
hHeightDset
指定目标矩形的高度,逻辑单位 
(*注:怀疑原文有误->Handle to the height, in logical units, of the destination rectangle. )
hdcSrc
源设备场景句柄.
nXOriginSrc
指定源矩形的左上角的X坐标,逻辑单位..
nYOriginSrc
指定源矩形的左上角的Y坐标,逻辑单位..
nWidthSrc
指定源矩形的区域宽度,逻辑单位.
nHeightSrc
指定源矩形的区域高度,逻辑单位
blendFunction
指定始末位图的Alpha混合函数(参数), 一个全局的应用于整个原始位图,提供原始位图格式信息的Alpha值.始末混合函数(参数)目前被限定为AC_SRC_OVER. 参考 BLENDFUNCTION 和 EMRALPHABLEND 结构.
返回值:

*注:BOOL类型是windows.h中long的类型声明,一般只有TRUE(1)和FALSE(0)两个值,当然你可以赋其他值.

函数执行成功返回TRUE,否则返回FALSE.

Windows NT: 获取更多错误信息, 调用GetLastError.

备注:

If the source rectangle and destination rectangle are not the same size, the source bitmap is stretched to match the destination rectangle. If the SetStretchBltMode function is used, the iStretchMode value is BLACKONWHITE and WHITEONBLACK; the iStretchMode value is automatically converted to COLORONCOLOR for this function.

The destination coordinates are transformed by using the transformation currently specified for the destination device context. The source coordinates are transformed by using the transformation currently specified for the source device context.

An error occurs (and the function returns FALSE) if the source device context identifies an enhanced metafile device context.

If destination and source bitmaps do not have the same color format, AlphaBlend converts the source bitmap to match the destination bitmap.

AlphaBlend does not support mirroring. If either the width or height of the source or destination is negative, this call will fail.

Note: The SourceConstantaAlpha member of BLENDFUNCTION specifies an alpha transparancy value to be used on the entire source bitmap. The SourceConstantAlpha value is combined with any per-pixel alpha values. If you set SourceConstantAlpha to 0, it is assumed that your image is transparent. Set the SourceConstantAlpha value to 255 (indicates that the image is opaque) when you only want to use per-pixel alpha values.

快速信息:

  Windows NT: Requires version 5.0 or later.
  Windows: Requires Windows 98 or later.
  Windows CE: Unsupported.
  Header: Declared in wingdi.h.
  Import Library: Included as a resource in msimg32.dll.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值