请问有源代码将bmp文件转化成565(16位)的数据流吗?函数输入是文件名,输出是数据比特流.
bmp2bit(char *filename, void *data).谢谢

解决方案 »

  1.   

    GetDIBitsThe GetDIBits function retrieves the bits of the specified compatible bitmap and copies them into a buffer as a DIB using the specified format.
      

  2.   

    1 先用LoadImage()将BMP文件转为HBITMAP句柄
    2 再用GetObject()得到HBITMAP句柄的位图信息
    3 然后通过GetDIBits()提取RGB像素数组
    4 最后转为565内存结构
      

  3.   

    Depends if the 16 bit colour mode you are using is 1:5:5:5 or 5:6:5. 
    Basically just chop off the least significant bits for each colour to 
    make up your new 16 bit colour. i.e. For 5:6:5 16 bit colour WORD Colour16 = 0; Colour16 |= ((red24 / 8) & 0x1f) << 11;        // 5 Most significant red bits 
    into high byte of colour 
    Colour16 |= ((green24 / 4) & 0x3f) << 5; // 6 Most significant green 
    Colour16 |= ((blue 24 / 8) & 0x1f); 
      

  4.   

    You can check out http://www.wotsit.org/ and find the specs for BMP files and see how they are stored. Their are many examples on how to save bitmaps
      

  5.   

    有源代码吗?我不太懂这个。我找到一个BCB的代码,可是我们公司没有这个软件,也不让装盗版。希望有一个VC的源代码。
    BMP文件是24位,输出二进制流为565(RGB)。 Practise_Think(时代“过客”) 说的好像跟我有的BCB的源代码类似,但。不知道用VC如何实现。
      

  6.   

    最好也有由565格式转化成位图的文件的函数。
    如: bit2bmp(void *ram, char *filename)
      

  7.   

    1 先用LoadImage()将BMP文件转为HBITMAP句柄
    2 再用GetObject()得到HBITMAP句柄的位图信息
    3 然后通过GetDIBits()提取RGB像素数组
    4 最后转为565内存结构第四步laiyiling(◆陌生人◆MVP◆) 的方法可行。
    但不知前三步怎么做?
      

  8.   

    前三步都是直接调用API函数啊!
      

  9.   

    BMP文件是24位,输出二进制流为565(RGB)。 那不是要处理下....