/*FUNCTION:  FTCGetPixels, get buffer hold pixels.
  PARAMETERS: bitmap
  piX, piY, piW, piH, return value indicate the position and width for changed area compared to the previous frame
  RETURN: buffer pointer, pixels are stored in RGB 24 bits, one bye one.No modification but just reading can be done to the buffer.
  NOTICE: Buffer length can be calculated as: width*height*3, in bytes.
*/
const void* FTCGetPixels( BITMAP* bitmap, int* piX, int* piY, int* piW, int* piH );目标是将一幅图写入buffer,要如何实现,,讲讲想法和关键步骤也行,,最好有源代码,,谢谢先

解决方案 »

  1.   

    http://www.aoi.it/code.htm
    有一个CXimage类,你可以参考参考
      

  2.   

    那个也太复杂了,,,有没有简单的代码,,我只是想把一张图纳入buffer
      

  3.   

    LoadImage
    GetBitmap
    GetBitmapBits
      

  4.   

    那需要多少bytes要如何计算?
      

  5.   

    如何知道一幅图需要多少bytes来存放?
      

  6.   

    const void* FTCGetPixels( BITMAP* bitmap, int* piX, int* piY, int* piW, int* piH 
    {}
      

  7.   


    const void* FTCGetPixels( BITMAP* bitmap, int* piX, int* piY, int* piW, int* piH 
    {
      return bmp->bmBits;
    }