Win32 C/C++ Load Image from memory buffer

后端 未结 4 545
日久生厌
日久生厌 2020-12-03 03:47

I want to load an image (.bmp) file on a Win32 application, but I do not want to use the standard LoadBitmap/LoadImage from Windows API: I want it to load from a buffer that

4条回答
  •  孤城傲影
    2020-12-03 04:32

    Try CreateBitmap():

    HBITMAP LoadBitmapFromBuffer(char *buffer, int width, int height)
    {
        return CreateBitmap(width, height, 1, 24, buffer);
    }
    

提交回复
热议问题