Convert image to 1 bpp bitmap in .net compact framework

后端 未结 3 2021
攒了一身酷
攒了一身酷 2020-12-03 09:05

I have an image of a signature I am trying to save as 1 bpp bitmap to save file space. The full .NET Framework has the enum PixelFormat.Format1bppIndexed, but

3条回答
  •  自闭症患者
    2020-12-03 09:46

    Creating and saving a bitonal bitmap is problematic even in the full framework.

    I previously authored an article on this issues involved.

    http://www.codeproject.com/KB/GDI-plus/BitonalImageConverter.aspx

    I revisited this code in the context of the compact framework and discovered as you did that the enum value does not exist, so you can't create a bitonal image from scratch.

    I'd be interested to know if you can load pre-existing bitonal images in the compact framework. If you can load pre-existing bitonal bitmaps, then it might be possible to go lower level and write the bitmap image format to disk or a memory stream directly, rather than use the GDI+ objects, but it would be non-trivial to do so.

提交回复
热议问题