_CreateDIBSectionIntPtr() private méthode

private _CreateDIBSectionIntPtr ( IntPtr hdc, [ bitmapInfo, int iUsage, [ ppvBits, IntPtr hSection, int dwOffset ) : SafeHBITMAP
hdc System.IntPtr
bitmapInfo [
iUsage int
ppvBits [
hSection System.IntPtr
dwOffset int
Résultat SafeHBITMAP
Exemple #1
0
        public static SafeHBITMAP CreateDIBSection(SafeDC hdc, ref BITMAPINFO bitmapInfo, out IntPtr ppvBits, IntPtr hSection, int dwOffset)
        {
            SafeHBITMAP safeHBITMAP;

            if (hdc == null)
            {
                safeHBITMAP = NativeMethods._CreateDIBSectionIntPtr(IntPtr.Zero, ref bitmapInfo, 0, out ppvBits, hSection, dwOffset);
            }
            else
            {
                safeHBITMAP = NativeMethods._CreateDIBSection(hdc, ref bitmapInfo, 0, out ppvBits, hSection, dwOffset);
            }
            if (safeHBITMAP.IsInvalid)
            {
                HRESULT.ThrowLastError();
            }
            return(safeHBITMAP);
        }