Hello,
I hope, some of the experts can help me.
I want to draw to a DIB created with CreateDIBSection, but I get an access violation.
Draw to dcMem leads to an access violation.Code:BITMAPINFO bmi; memset(&bmi,0,sizeof(BITMAPINFO)); tBYTE* lpBits; bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); glTexSize=4096; bmi.bmiHeader.biWidth = glTexSize; bmi.bmiHeader.biHeight = glTexSize; bmi.bmiHeader.biPlanes = 1; /* must be 1 */ bmi.bmiHeader.biBitCount = 24; bmi.bmiHeader.biCompression = BI_RGB; // Create DIB for rendering context tHANDLE dib =CreateDIBSection(dcMem.m_hDC,&bmi,DIB_RGB_COLORS,(void**)&lpBits, NULL, 0); tHANDLE old=::SelectObject(dcMem.m_hDC,dib); // Draw to dcMem with GDI .......
What is wrong?
Do I need to allocate memory?
thx.




Reply With Quote