###User Defined Function###
_WinAPI_CreateDIBSection

###Description###
Creates a DIB that applications can write to directly.

###Syntax###
#include <WinAPIGdi.au3>
_WinAPI_CreateDIBSection ( $hDC, $tBITMAPINFO, $iUsage, ByRef $pBits [, $hSection = 0 [, $iOffset = 0]] )


###Parameters###
@@ParamTable@@
$hDC
	Handle to a device context. If the value of $iUsage is $DIB_PAL_COLORS, the function uses this device context's logical palette to initialize the DIB colors.
$tBITMAPINFO
	$tagBITMAPINFO structure that specifies various attributes of the DIB, including the bitmap dimensions and colors.
$iUsage
	The type of colors used (either logical palette indexes or literal RGB values). The following values are defined:
		$DIB_PAL_COLORS
		$DIB_RGB_COLORS
$pBits
	Returns a pointer to the location of the DIB bit values.
$hSection
	[optional] Handle to a file-mapping object that the function will use to create the DIB.
$iOffset
	[optional] The offset from the beginning of the file-mapping object referenced by $hSection where storage for the bitmap bit values is to begin. This value is ignored if $hSection is 0 (Default).
@@End@@

###ReturnValue###
@@ReturnTable@@
Success 	Handle to the newly created DIB, and $pBits points to the bitmap bit values.
	You can create the structure by using $pBits pointer to further its filling.
	For example, DllStructCreate('dword[256]', $pBits).
Failure 	0, $pBits is set to 0.
@@End@@


###Remarks###
When you no longer need the bitmap, call the <a href="_WinAPI_DeleteObject.htm">_WinAPI_DeleteObject()</a> function to delete it.


###Related###
_WinAPI_DeleteObject


###See Also###
@@MsdnLink@@ CreateDIBSection


###Example###
@@IncludeExample@@
