Android: Converting a Bitmap to a Monochrome Bitmap (1 Bit per Pixel)

前端 未结 4 1579
一向
一向 2020-12-05 00:57

I want to print a Bitmap to a mobile Bluetooth Printer (Bixolon SPP-R200) - the SDK doesn\'t offer direkt methods to print an in-memory image. So I thought about converting

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-05 01:23

    Well I think its quite late now to reply to this thread but I was also working on this stuff sometimes back and decided to build my own library that will convert any jpg or png image to 1bpp .bmp. Most printers that require 1bpp images will support this image (tested on one of those :)). Here you can find library as well as a test project that uses it to make a monochrome single channel image. Feel free to change it..:)

    https://github.com/acdevs/1bpp-monochrome-android

    Enjoy..!! :)

提交回复
热议问题