Creating 8bpp bitmap with GDI and saving it as a file

后端 未结 3 1046
礼貌的吻别
礼貌的吻别 2021-01-15 06:46

I have a perfectly working code that creates 32bpp bitmap and I need to change it so that 8bpp bitmap is created.

Here\'s the piece of code that creates 32bpp bitmap,

3条回答
  •  借酒劲吻你
    2021-01-15 07:09

    You need to specify the size of the palette that you attached. Right now it's zero, so the palette is showing up as the first bunch of pixels in your image.

    bmi.bmiHeader.biClrUsed = 256;
    

提交回复
热议问题