Should you be setting bmi.bmiHeader.biSizeImage before calling SetDIBits? I only say this because I found the following I'd used which uses GetDIBits to calculate it's value:
// Calculate the biSizeImage parameter using GetDIBits or manually if this failsint ScanLines = GetDIBits(hMemDC,hBmp,0,B1Win.ylen,NULL,lpbmInfo,DIB_RGB_COLORS);
if(lpbmInfo->bmiHeader.biSizeImage == 0)
lpbmInfo->bmiHeader.biSizeImage = ((((lpbmInfo->bmiHeader.biWidth * lpbmInfo->bmiHeader.biBitCount) + 31) & ~31) >> 3) * lpbmInfo->bmiHeader.biHeight;
// Copy bits from RGB888 to 24 bit DIB and inverting bitmap
ScanLines = (int)(InControl.VideoRoi.ylen); // SetDIBits inverts if height is -ve// biHeight originally set -ve here
ScanLines = SetDIBits(hMemDC,hBmp,0,ScanLines,BDBoard.pcnvBuffer,lpbmInfo,DIB_RGB_COLORS);
In Western European fonts, the widest character is usually capital letter M (that's why typesetters refer to em-height and em-width). Most fonts will contain a character call em_space, which is a space that is exactly as wide as the widest character in the font.
Hello, I am currently working on an MFC project. The project have a treeview and listview similar to the layout of windows registry editor. I was just wondering if any of you guys know how to change the focus wherein if the user click one item in the treeview and then presses the tab key the focus would be changed to the corresponding item in the listview? Please help.