123456789101112
BITMAPINFO bmi; std::fill(reinterpret_cast<std::uint8_t *>(&bmi), reinterpret_cast<std::uint8_t *>(&bmi) + sizeof(bmi), 0); bmi.bmiHeader.biSize = sizeof(bmi); bmi.bmiHeader.biWidth = extent.x; bmi.bmiHeader.biHeight = extent.y; bmi.bmiHeader.biPlanes = 1; bmi.bmiHeader.biBitCount = 32; bmi.bmiHeader.biCompression = BI_RGB; const HDC cur_hdc = ...; const HBITMAP hb = CreateDIBSection(cur_hdc, &bmi, DIB_RGB_COLORS, &result, 0, 0);
result