示例#1
0
 public static Standard.SafeHBITMAP CreateDIBSection(Standard.SafeDC hdc, ref Standard.BITMAPINFO bitmapInfo, out IntPtr ppvBits, IntPtr hSection, int dwOffset)
 {
     Standard.SafeHBITMAP ehbitmap = null;
     if (hdc == null)
     {
         ehbitmap = _CreateDIBSectionIntPtr(IntPtr.Zero, ref bitmapInfo, 0, out ppvBits, hSection, dwOffset);
     }
     else
     {
         ehbitmap = _CreateDIBSection(hdc, ref bitmapInfo, 0, out ppvBits, hSection, dwOffset);
     }
     if (ehbitmap.IsInvalid)
     {
         Standard.HRESULT.ThrowLastError();
     }
     return(ehbitmap);
 }
示例#2
0
 private static extern Standard.SafeHBITMAP _CreateDIBSectionIntPtr(IntPtr hdc, [In] ref Standard.BITMAPINFO bitmapInfo, int iUsage, out IntPtr ppvBits, IntPtr hSection, int dwOffset);