public static unsafe IntPtr CreateDIBSection(IntPtr hdc, ref BitmapInfoHeader bitmapInfoHeader, DibBmiColorUsageFlag iUsage, out IntPtr ppvBits, IntPtr hSection, uint dwOffset) { fixed(BitmapInfoHeader *bitmapInfoHeaderPtr = &bitmapInfoHeader) { return(Gdi32Methods.CreateDIBSection(hdc, new IntPtr(bitmapInfoHeaderPtr), iUsage, out ppvBits, hSection, dwOffset)); } }
public static IntPtr CreateDIBSection(IntPtr hdc, ref BitmapInfo bitmapInfo, DibBmiColorUsageFlag iUsage, out IntPtr ppvBits, IntPtr hSection, uint dwOffset) { using (var pbmi = BitmapInfo.NativeAlloc(ref bitmapInfo)) { return(Gdi32Methods.CreateDIBSection(hdc, pbmi.GetDangerousHandle(), iUsage, out ppvBits, hSection, dwOffset)); } }