Add possibility to set for BitmapRenderer to output monochrome images at a color depth of 1 bit per pixel?
Currently BitmapRenderer output images having a PixelFormat of Format24bppRgb, but since barcodes are 99% of the times black & white (monochrome), it would be nice to set the format to Format1bppIndexed.
As a bonus, it would be nice to have the RawFormat property of Bitmap (Image) to a value different than ImageFormat.MemoryBmp since the method ImageFormat.FindEncoder can't find an encoder for MemoryBmp and I experience crashes when using POS for .NET and printing that barcode with the PosPrinter.PrintMemoryBarcode method.
Thanks!
Do you know a way to change the RawFormat value? It is a readonly-property.
Enabling changing the pixel format means a complete rewrite of the main method of the renderer. Perhaps you can use the following code snippet meanwhile: var bmp1bpp = bmp.Clone(new Rectangle(0, 0, bmp.Width, bmp.Height), PixelFormat.Format1bppIndexed);
That's exactly the same workaround/hack i am using at the moment. If this won't get implemented by nobody else and I'll come up with an elegant and performant way to do so I'll open a CR