The problem is with ImageSharp method DrawLines. This method will not draw a line in the form of a solid rectangle if the pen width is equal to or greater than 2 :-(
I suggest using the method FillPolygon, and the corresponding code would look like this:
Hi @Tagliatti, first of all, thank you for your library!
I have been using the library for some time, namely for Code128C. I encountered a problem with versions 1.5+, which I already wrote about (Issue #29).
Result for version 1.4.5 Result for version 1.6.0
In the latest version barcode lines are rendered as thicker and when I use
barcode.GetBase64Image();
the barcode is really corrupted.I tried to figure out the cause of the problem and found that the problem is in this part of the code:
The problem is with ImageSharp method DrawLines. This method will not draw a line in the form of a solid rectangle if the pen width is equal to or greater than 2 :-(
I suggest using the method FillPolygon, and the corresponding code would look like this:
The variable pen is no longer needed. And result for modified version 1.6.0 is the same as the one generated by the library version 1.4.5!
What do you think? Wouldn't it work better this way?