Giter Club home page Giter Club logo

Comments (4)

Tagliatti avatar Tagliatti commented on July 28, 2024 1

@kalatchev @nomaddamon added this feature in version 1.4

from netbarcode.

Tagliatti avatar Tagliatti commented on July 28, 2024

Upgrade to the new version 1.1.0, it has a constructor with all parameters and a new public method GetImage() to manipulate the image.

from netbarcode.

kalatchev avatar kalatchev commented on July 28, 2024

Hi @Tagliatti ,

Thanks for your answer. I think I was misunderstood. What I asked is if it's possible to control bars width (thin and/or wide) and to have them with fixed values. Let say I have to encode two strings: "ABCD" and "ABCDEFGH". I would like to make bars with fixed width and as a result I should have something like this:

image

Later I took a look at the code and realized that bars width are calculated dynamically to stretch the result image. In all construcors, I see _autoSize = false;, and later, when barcode is drawn we have

   if (_autoSize)
            {
                _width = barWidth * _encodedData.Length;

                _height = _width / aspectRatio;
            }
...
   var iBarWidth = _width / _encodedData.Length;
...

In did not investigate whole the code, but what I see is that bars width will be calculated and then the barcode will be stretched. And here what I have as a result:

image

Produced with this code:

var bc = new Barcode("ABCDEFGH", Type.Code128, true, 250, 110, LabelPosition.BottomCenter, AlignmentPosition.Left, Color.White, Color.Black, new Font("Arial", 10));

The point is that the thin and wide bars in first and second case has different widths. From now on, many issues with scanners can occur. So finally, what I would like to have is to set height of the barcode and width of the bars, and to get an image with final width as wide as needed like my first example (made with https://www.morovia.com/free-online-barcode-generator/ where the aproach is like mine).

from netbarcode.

kalatchev avatar kalatchev commented on July 28, 2024

Thanks @Tagliatti !

from netbarcode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.