问一个API函数的格式问题,也就是MSDN中
这是我在MSDN2008中看到函数解释,有的意思目前不是很明确,想确认一下!
The AlphaBlend function displays bitmaps that have transparent or semitransparent pixels.
BOOL AlphaBlend(
HDC hdcDest, // handle to destination DC
int nXOriginDest, // x-coord of upper-left corner
int nYOriginDest, // y-coord of upper-left corner
int nWidthDest, // destination width
int nHeightDest, // destination height
HDC hdcSrc, // handle to source DC
int nXOriginSrc, // x-coord of upper-left corner
int nYOriginSrc, // y-coord of upper-left corner
int nWidthSrc, // source width
int nHeightSrc, // source height
BLENDFUNCTION blendFunction // alpha-blending function
);
第一问:
在MSDN中上面的 “HDC hdcDest,”中的“hdcDest”是可以点击的,点击后弹出一个窗口,窗口内容如下:
hdcDest
[in] Handle to the destination device context. ——前面的[in]代表什么?是代表输入吗?
第二问
第三行“int nXOriginDest, ”其中“int” 表示的是整形,我在vb中引用的话,是用integer还是long?我看vb基本上使用的都是long,这是不是规定好了的?
先谢谢大家!
[解决办法]
2: C的INT对应着VB的Long
[解决办法]
1)输入参数,VB 中就是 ByVal
2)C 的 int 是 4 字节,VB 中对应 Long
Public Type BLENDFUNCTION BlendOp As Byte BlendFlags As Byte SourceConstantAlpha As Byte AlphaFormat As ByteEnd TypePublic Declare Function AlphaBlend Lib "msimg32.dll" ( _ ByVal hdcDest As Long, _ ByVal xDest As Long, _ ByVal yDest As Long, _ ByVal WidthDest As Long, _ ByVal HeightDest As Long, _ ByVal hdcSrc As Long, _ ByVal xSrc As Long, _ ByVal ySrc As Long, _ ByVal WidthSrc As Long, _ ByVal HeightSrc As Long, _ ByRef Blendfunc As As BLENDFUNCTION) As Long
[解决办法]
1,对,[in]输出[out]输出,比如:
GetWindowExtEx
This function retrieves the x-extent and y-extent of the window for the specified device context.
BOOL GetWindowExtEx(
HDC hdc, // handle to device context
LPSIZE lpSize // window extents
);
Parameters
hdc
[in] Handle to the device context.
lpSize
[out] Pointer to a SIZE structure that receives the x- and y-extents in page-space units, that is, logical units.
2,int在这种MSDN API文档中是指4字节的有符号整数,对应VB6中的long(integer只有2字节),而在VB7开始的vb.net各版本中,则是Integer(4字节),long(8字节)