createdibsection

CreateDIBSection failed

BITMAPINFO bmi; memset(&bmi,0,sizeof(BITMAPINFO)); bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bmi.bmiHeader.biWidth =m_pImg->GetWidth(); bmi.bmiHeader.biHeight =m_pImg->GetHeight(); bmi.bmiHeader.biPlanes = 1; //if( m_pImg->GetInfo()->biBitCount!=16) //{ // bmi.bmiHeader.biBitCount = m_pImg->GetInfo()->biBitCount; //} //e...

about the call of CreateDIBSection in a thread

in a function named buildtexture, it loaded the image and build texture for OpenGL, when i called CreateDIBSection, it will creat a bitmap. If the function buildtexture was called as a normal member function, there will be nothing wrong. But if i called this member function in a thread, the CreateDIBSection will return 0 that means it f...

call of CreateDIBSection failed in a thread

in a function named buildtexture, it loaded the image and build texture for OpenGL, when i called CreateDIBSection, it will creat a bitmap. If the function buildtexture was called as a normal member function, there will be nothing wrong. But if i called this member function in a thread, the CreateDIBSection will return 0 that means it f...

CreateDIBSection is throwing, when trying to create cursor on Win

Hi, I am trying to create Cursor from png, and CreateDIBSection() is throwing. Follwoing is the snippet of code: HDC hdc = GetDC(NULL); void* lpBits = NULL; HBITMAP hBitmap; try { hBitmap = CreateDIBSection( hdc, (BITMAPINFO*)&bi, 0, &lpBits, NULL, (DWORD)0); } ReleaseDC(NULL, hdc); As CreateDIBSection is throwing, th...

CreateDIBSection leaving 'Not enough storage' error, but seems to still work anyway

Whenever my app tries to create a DIB section, either by calling CreateDIBSection(), or by calling LoadImage() with the LR_CREATEDIBSECTION flag, it seems to return successfully. The HBITMAP it returns is valid, and I can manipulate and display it just fine. However, calls to GetLastError() will return 8: Not enough storage is availabl...

BitBlt + UpdateLayeredWindow and CreateDIBSection in 16-bit desktop color depth

Hello there! I have an application with transparent background in client area which is drawn black because the window is not layered. In each of it's WM_PAINT messages I am doing a BitBlt to a memory-DC, after that I use the memory-DC with UpdateLayeredWindow to a layered canvas window. setup of memory-DC: HDC hdcMemory = CreateCompat...