示例#1
0
文件: Helpers.cs 项目: zyj0021/WinApi
 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));
     }
 }
示例#2
0
文件: Helpers.cs 项目: zyj0021/WinApi
 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));
     }
 }