函数参考


_WinAPI_CreateDIB

创建未压缩且设备无关的位图

#Include <WinAPIEx.au3>
_WinAPI_CreateDIB ( $iWidth, $iHeight [, $iBitsPerPel [, $tColorTable [, $iColorCount]]] )

参数

$iWidth 位图像素宽度
$iHeight 位图像素高度.
该值为正数时位图为自下而上且起点在左下角的DIB, 反之为自上而下且起点在左上角.
$iBitsPerPel [可选参数] 定义没像素位数及位图中颜色的最大数量
$tColorTable [可选参数] "dword[n]" structure that represents a DIB color table. The number of colors in this table
depends on the values of the $iBitsPerPel parameters.
$iColorCount [可选参数] The number of color indexes in the DIB color table that are actually used by the bitmap.
The value of this parameter should not exceed the number of colors in the color table pointed
to by the $pColorTable parameter.

返回值

成功: 返回DIB句柄
失败: 返回 0并设置@error非0

注意/说明

If the bitmap is monochrome (1 bits-per-pixel), the color table should contain two entries. If the color table
is not specified, the function creates a monochrome bitmap with black and white colors. If the bitmap use 4 or
8 bits-per-pixel, the color table should contain up to 16 or 256 entries respectively. In this case, if the
color table is not specified, the function creates an empty color table (all colors is black) with the maximum
possible number of entries for the specified color depth. You can fill out this color table later by using the
_WinAPI_SetDIBColorTable() function. If the bitmap use 16, 24, or 32 bits-per-pixel, the color table is not
used, and $tColorTable parameter is ignored.

This function does not create a compressed 16, 24, or 32 bits-per-pixel bitmaps, that is the "biCompression"
member of $tagBITMAPINFO structure is always 0 ($BI_RGB).

位图使用完毕后使用_WinAPI_DeleteObject()销毁.

Call _WinAPI_GetExtended() to retrieve a pointer to the location of the DIB bit values.

相关

详情参考

None