网站首页  词典首页

请输入您要查询的函数:

 

术语 getdibits
释义 GetDIBits
语法:
int GetDIBits(
__in HDC hdc,
__in HBITMAP hbmp,
__in UINT uStartScan,
__in UINT cScanLines,
__out LPVOID lpvBits,
__inout LPBITMAPINFO lpbi,
__in UINT uUsage
);
GetDIBits函数
该GetDIBits函数检索到的DIB作为缓冲区指定兼容位图,并把它们拷贝的位使用指定的格式。
参数
hdc [in]
一个句柄,设备上下文。
骨形成蛋白 [in]
阿位图句柄。这必须是一个兼容的位图(DDB)。
uStartScan [in]
第一扫描线来检索。
cScanLines [in]
在扫描线数检索。
lpvBits [out]
一个缓冲区指针接收位图数据。如果该参数为NULL,函数传递的尺寸和格式的位图的BITMAPINFO结构指向的lpbi参数。
lpbi [ in , out ]
一个BITMAPINFO结构,指定为DIB的数据所需的格式的指针。
uUsage [in]
该BITMAPINFO结构的成员bmiColors格式。它必须是下列值之一。
ValueMeaning
DIB_PAL_COLORSThe颜色表应包括的16个数组到当前的逻辑调色板位索引。
DIB_RGB_COLORSThe颜色表应包括文字红,绿,蓝(RGB)值。
返回值
如果lpvBits参数不为NULL和函数成功,返回值是从位图扫描复制的行数。
如果lpvBits参数为NULL和GetDIBits成功地填补了BITMAPINFO结构,返回值为非零。
如果函数失败,返回值是零。
这个函数可以返回以下值。
返回codeDescription
ERROR_INVALID_PARAMETEROne或输入参数更是无效的。
备注
如果对DIB的请求的格式相匹配的内部格式,位图的RGB值被复制。如果请求的格式不匹配的内部格式,颜色表的合成。下表描述了颜色表每种格式合成。
ValueMeaning
1_BPPThe颜色表包括黑色和白色项。
4_BPPThe颜色表包括一个颜色相同的标准VGA调色板组合。
8_BPPThe颜色表由一组由GDI定义的256种颜色一般组合。 (包括在这些256色是20个预设的逻辑调色板中的颜色。)
24_BPPNo颜色表返回。
如果lpvBits参数是一个有效的指针,前6 BITMAPINFOHEADER结构的成员必须被初始化为指定的大小和DIB格式。扫描必须在DWORD对齐除了游程压缩位图线。
阿自下而上DIB是通过设置指定高度为正数,而自上而下的DIB是通过设置高度为负数指定。位图颜色表将被追加到BITMAPINFO结构。
如果lpvBits为NULL,GetDIBits审查第一结构的第一个成员所指向的lpbi。该成员必须指定大小,以字节为单位,一个BITMAPCOREHEADER或BITMAPINFOHEADER结构。该函数使用指定的大小来确定的其余成员应被初始化。
如果lpvBits为NULL,以及BITMAPINFO位计数的成员被初始化为零,GetDIBits填充颜色表没有在BITMAPINFOHEADER结构或BITMAPCOREHEADER。这种技术可用于查询位图的属性。
人骨形成蛋白参数的确定的位图不能选择到设备上下文当应用程序调用该函数。
对于自下而上的起源了DIB是左下角位图的角落;为自上而下的起源是DIB的左上角。
实例
有关示例,请参见捕捉图像。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWingdi.h(头文件:winuser.h)
LibraryGdi32.lib
DLLGdi32.dll
参见
位图概述
位图功能
BITMAPCOREHEADER
BITMAPINFO
位图信息
SetDIBits
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==GetDIBits Function
The GetDIBits function retrieves the bits of the specified compatible bitmap and copies them into a buffer as a DIB using the specified format.
Syntax
int GetDIBits(
__in HDC hdc,
__in HBITMAP hbmp,
__in UINT uStartScan,
__in UINT cScanLines,
__out LPVOID lpvBits,
__inout LPBITMAPINFO lpbi,
__in UINT uUsage
);
Parameters
hdc [in]
A handle to the device context.
hbmp [in]
A handle to the bitmap. This must be a compatible bitmap (DDB).
uStartScan [in]
The first scan line to retrieve.
cScanLines [in]
The number of scan lines to retrieve.
lpvBits [out]
A pointer to a buffer to receive the bitmap data. If this parameter is NULL, the function passes the dimensions and format of the bitmap to the BITMAPINFO structure pointed to by the lpbi parameter.
lpbi [in, out]
A pointer to a BITMAPINFO structure that specifies the desired format for the DIB data.
uUsage [in]
The format of the bmiColors member of the BITMAPINFO structure. It must be one of the following values.
ValueMeaning
DIB_PAL_COLORSThe color table should consist of an array of 16-bit indexes into the current logical palette.
DIB_RGB_COLORSThe color table should consist of literal red, green, blue (RGB) values.

Return Value
If the lpvBits parameter is non-NULL and the function succeeds, the return value is the number of scan lines copied from the bitmap.
If the lpvBits parameter is NULL and GetDIBits successfully fills the BITMAPINFO structure, the return value is non-zero.
If the function fails, the return value is zero.
This function can return the following value.
Return codeDescription
ERROR_INVALID_PARAMETEROne or more of the input parameters is invalid.

Remarks
If the requested format for the DIB matches its internal format, the RGB values for the bitmap are copied. If the requested format doesn't match the internal format, a color table is synthesized. The following table describes the color table synthesized for each format.
ValueMeaning
1_BPPThe color table consists of a black and a white entry.
4_BPPThe color table consists of a mix of colors identical to the standard VGA palette.
8_BPPThe color table consists of a general mix of 256 colors defined by GDI. (Included in these 256 colors are the 20 colors found in the default logical palette.)
24_BPPNo color table is returned.

If the lpvBits parameter is a valid pointer, the first six members of the BITMAPINFOHEADER structure must be initialized to specify the size and format of the DIB. The scan lines must be aligned on a DWORD except for RLE compressed bitmaps.
A bottom-up DIB is specified by setting the height to a positive number, while a top-down DIB is specified by setting the height to a negative number. The bitmap color table will be appended to the BITMAPINFO structure.
If lpvBits is NULL, GetDIBits examines the first member of the first structure pointed to by lpbi. This member must specify the size, in bytes, of a BITMAPCOREHEADER or a BITMAPINFOHEADER structure. The function uses the specified size to determine how the remaining members should be initialized.
If lpvBits is NULL and the bit count member of BITMAPINFO is initialized to zero, GetDIBits fills in a BITMAPINFOHEADER structure or BITMAPCOREHEADER without the color table. This technique can be used to query bitmap attributes.
The bitmap identified by the hbmp parameter must not be selected into a device context when the application calls this function.
The origin for a bottom-up DIB is the lower-left corner of the bitmap; the origin for a top-down DIB is the upper-left corner.
Examples
For an example, see Capturing an Image .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWingdi.h (include Windows.h)
LibraryGdi32.lib
DLLGdi32.dll
See Also
Bitmaps Overview
Bitmap Functions
BITMAPCOREHEADER
BITMAPINFO
BITMAPINFOHEADER
SetDIBits
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd144879(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:28:16