pInfo->bmiHeader.biSize=40;
pInfo->bmiHeader.biWidth=320;
pInfo->bmiHeader.biHeight=240;
pInfo->bmiHeader.biPlanes=1;
pInfo->bmiHeader.biBitCount=8;
pInfo->bmiHeader.biCompression=0;
pInfo->bmiHeader.biSizeImage=0;
pInfo->bmiHeader.biXPelsPerMeter=0;
pInfo->bmiHeader.biYPelsPerMeter=0;
pInfo->bmiHeader.biClrUsed=0;
pInfo->bmiHeader.biClrImportant=0;
pInfo->bmiColors->rgbBlue=0;
pInfo->bmiColors->rgbGreen=0;
pInfo->bmiColors->rgbRed=0;
pInfo->bmiColors->rgbReserved=0;

解决方案 »

  1.   

    参考一下下面代码(我程序中的)
    CBitmap bmp;
    bmp.LoadBitmap(IDB_DX_LOGO);
    CDC dc;
    dc.CreateCompatibleDC(pDC);
    dc.SelectObject(&bmp);
    BITMAP bm;
    bmp.GetBitmap(&bm);
    pDC->StretchBlt(0,0,rect.Width(),rect.Height(),&dc,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY);//pDC是视图的
      

  2.   

    关键是这句
    dc.CreateCompatibleDC(pDC);
    这是创建于显示器匹配的dc
    看看你的显示器配置是多少色吧,多半都是真彩色,怎么可能显示的出256色呢,你把显示器配置改为256色,多半就可以了:)
      

  3.   

    pyh(天天) :
    我如果不改显示器配置,怎么实现呢
      

  4.   

    要设置调色板,看看这篇文章
    http://eastgod.myrice.com/vcpic/002.htm