   CreateDIBSection
  Hi guys i have the following problem.I create and initialize a DIB section like this:   //Init the DIB sectionBITMAPINFO bi;memset(&bi,0,sizeof(BITMAPINFO));bi.bmiHeader.biSize= sizeof(BITMAPINFOHEADER);bi.bmiHeader.biWidth= width;bi.bmiHeader.biHeight= height;bi.bmiHeader.biPlanes= 1;bi.bmiHeader.biBitCount= 24;bi.bmiHeader.biCompression= BI_RGB;HDC hdc = GetDC(g_hWnd);hDIB = CreateDIBSection(hdc,&bi,DIB_RGB_COLORS,(void**)bits,NULL,0);if(!hDIB)    Message(MB_OK|MB_ICONERROR,"Cannot create DIB section!");for(int i = 0;i < 10;i++)for(int j = 0;j < 10;j++)bits[i*10+j] = rand() % 256;HDC hCopy = CreateCompatibleDC(hdc);SelectObject(hCopy,hDIB);BitBlt(hdc,0,0,width,height,hCopy,0,0,SRCCOPY);DeleteDC(hCopy);ReleaseDC(g_hWnd,hdc);but the problem is that everything is black.Something''s wrong with the bit array or what?   "Tonight we strike,there is thunder in the sky,together we''ll fight,some of us will die,but they''ll always remember that we''ve made a stand and many will die by hand!" - ManOwaR 