This code works fine with files created by Paint.Net 4.0.x and the old BMPX export DLL (BMP32 Paint.NET FileType.dll):
m_hbm = (HBITMAP)::LoadImage(hInst, MAKEINTRESOURCE(idb_toolbar), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);
if (m_hbm == NULL)
{
DWORD derr = GetLastError();
Logger("toolbar LoadImage error = %d %u %x", derr, derr, derr);
}
m_ilToolBar = ImageList_Create(bmpw, bmph, ILC_COLOR32, 11, 4);
ok2 = ImageList_Add(m_ilToolBar, m_hbm, NULL);
If I use 4.3.12 with the same PDN file and save as 32-bit BMP, the ::LoadImage fails with GetLastError() == 183: 11:58:24.266 - toolbar LoadImage error = 183 183 b7
If I look at the old DLL export and the new built-in export, I see that the new version uses a larger header. I can provide samples of both if needed.
Our use case is creating bitmaps with transparency for Windows UI elements like toolbar buttons. The old Win32 API calls won't read PNG.