我原以为用CBitmap::GetBitmapBits可以获取Bitmap中的RGB数据,实际上确不是那么回事。这个函数浪费了我整整一个上午的时间来检查自己的程序是否有错。那位达人知道这个函数有什么用啊?怎么用?

解决方案 »

  1.   

    就是用来获取Bitmap中的RGB数据啊。
      

  2.   

    这个函数是为了兼容16位Windows而设定的。32位Windows下应该使用GetDIBits
    int GetDIBits(
      HDC hdc,           // handle to DC
      HBITMAP hbmp,      // handle to bitmap
      UINT uStartScan,   // first scan line to set
      UINT cScanLines,   // number of scan lines to copy
      LPVOID lpvBits,    // array for bitmap bits
      LPBITMAPINFO lpbi, // bitmap data buffer
      UINT uUsage        // RGB or palette index
    );