How to generate the barcode 128 in Qpixmap ?
-
I understand that the number of sticks is changing. But the pixel size of the image changes by 1.25 times or 1. And the picture is cropped and the barcode is not correct.


Here 2 pictures of the same size, but one the size of the shaded zone higher in 1,25. Why so? -
I understand that the number of sticks is changing. But the pixel size of the image changes by 1.25 times or 1. And the picture is cropped and the barcode is not correct.


Here 2 pictures of the same size, but one the size of the shaded zone higher in 1,25. Why so?@Mihaill
Hi
the programmer made it so, it seems.void Code128Item::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) { float lineWidth = m_Width / m_CodeLength; /* * This code tries to fit the barcode right inside the width. If the code * is too long this means that the bar width goes below one pixel. Which in * turn means we get no barcode. On printers this is not a problem too fast * as they have 600 DPI usually. Screens with 96 DPI run out faster. * */ if ( !m_HighDPI ) { lineWidth = qRound(lineWidth); if ( lineWidth < 1 ) { lineWidth = 1; } }so it tries to fit in area and might alter the lineWidth. and hence the barcode has a different size.
try
m_Barcode->setHighDPI(true);