CreateDIBSection function gdi32

Win32Result<HBITMAP> CreateDIBSection(
  1. HDC? hdc,
  2. Pointer<BITMAPINFO> pbmi,
  3. DIB_USAGE usage,
  4. Pointer<Pointer<NativeType>> ppvBits,
  5. HANDLE? hSection,
  6. int offset,
)

Creates a DIB that applications can write to directly.

To learn more, see learn.microsoft.com/windows/win32/api/wingdi/nf-wingdi-createdibsection.

Implementation

Win32Result<HBITMAP> CreateDIBSection(
  HDC? hdc,
  Pointer<BITMAPINFO> pbmi,
  DIB_USAGE usage,
  Pointer<Pointer> ppvBits,
  HANDLE? hSection,
  int offset,
) {
  resolveGetLastError();
  final result_ = _CreateDIBSection(
    hdc ?? nullptr,
    pbmi,
    usage,
    ppvBits,
    hSection ?? nullptr,
    offset,
  );
  return .new(value: .new(result_), error: GetLastError());
}