点击或拖拽改变大小

UnmanagedMethodsGetDIBits 方法

Retrieves the bits of the specified compatible bitmap and copies them into a buffer as a DIB using the specified format.

命名空间:  CPF.Windows
程序集:  CPF.Windows (在 CPF.Windows.dll 中) 版本:0.8.8.5
语法
C#
public static int GetDIBits(
	IntPtr hdc,
	IntPtr hbmp,
	uint uStartScan,
	uint cScanLines,
	byte[] lpvBits,
	ref UnmanagedMethodsBITMAPINFOHEADER lpbi,
	DIB_Color_Mode uUsage
)

参数

hdc
类型:SystemIntPtr
A handle to the device context.
hbmp
类型:SystemIntPtr
A handle to the bitmap. This must be a compatible bitmap (DDB).
uStartScan
类型:SystemUInt32
The first scan line to retrieve.
cScanLines
类型:SystemUInt32
The number of scan lines to retrieve.
lpvBits
类型:SystemByte
A pointer to a buffer to receive the bitmap data. If this parameter is Zero, the function passes the dimensions and format of the bitmap to the UnmanagedMethodsBITMAPINFO structure pointed to by the lpbi parameter.
lpbi
类型:CPF.WindowsUnmanagedMethodsBITMAPINFOHEADER
A pointer to a UnmanagedMethodsBITMAPINFO structure that specifies the desired format for the DIB data.
uUsage
类型:CPF.WindowsDIB_Color_Mode
The format of the bmiColors member of the UnmanagedMethodsBITMAPINFO structure. It must be one of the following values.

返回值

类型:Int32
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 UnmanagedMethodsBITMAPINFO structure, the return value is nonzero. If the function fails, the return value is zero. This function can return the following value: ERROR_INVALID_PARAMETER (87 (0×57))
参见