Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8267359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:29:44+00:00 2026-06-08T05:29:44+00:00

Is vector based generators the best way to generate barcodes? If yes, what are

  • 0

Is vector based generators the best way to generate barcodes? If yes, what are the namespaces that it will make use of? How is it used? Can anyone share some knowledge on this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T05:29:45+00:00Added an answer on June 8, 2026 at 5:29 am

    Assuming that we are talking about UPC like barcodes, vector based generation is not a must. It’s the matter of representing some bits as vertical lines. So, you can easily do this using any graphic library or even using direct access to video buffer. You can represent a single bit with multiple pixels if you need a larger barcode. You don’t need to use any interpolation I guess. But if you need a certain size (in pixels/centimeters etc.), vector based solution might be handful but still not a must.

    C# source code example for generating scalable barcode graphics.

    Steps:

    1) Open a new C# Windows Forms sample project named BarCode.

    2) Add a PictureBox and change BackColor to White and Dock to Fill.

    3) Add Load and Resize events to Form1.

    4) Copy & Paste the source code below over Form1.cs file.

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    namespace BarCode
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            public bool[] barCodeBits;
    
            private void Form1_Load(object sender, EventArgs e)
            {
                Random r = new Random();
                int numberOfBits = 100;
                barCodeBits = new bool[numberOfBits];
                for(int i = 0; i < numberOfBits; i++) {
                    barCodeBits[i] = (r.Next(0, 2) == 1) ? true : false;
                }
    
                Form1_Resize(null, null);
            }
    
            private void Form1_Resize(object sender, EventArgs e)
            {
                int w = pictureBox1.Width;
                int h = pictureBox1.Height;
    
                pictureBox1.Image = new Bitmap(pictureBox1.Width, pictureBox1.Height);
                Graphics g = Graphics.FromImage(pictureBox1.Image);
                Brush b = new SolidBrush(Color.Black);
    
                for(int pos = 0; pos < barCodeBits.Length; pos++) {
                    if(barCodeBits[pos]) {
                        g.FillRectangle(b, ((float)pos / (float)barCodeBits.Length) * w, 0, (1.0f / (float)barCodeBits.Length) * w, h);
                    }
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

both recursion as well as vector based iterative process can be used for DFS
maybe I'm missing something. I believed that WPF vector-based Drawings (like DrawingGroup, DrawingGeometry, etc.)
I'm trying to implement a class that will generate all possible unordered n-tuples or
I'm building a Flex application that creates neat vector images based on some options/filters.
Possible Duplicate: R: generate a repeating sequence based on vector To create the vector
Is there a way to remove an item from a vector based on index
I have a handle-based class that I need to create a vector of. An
We use iText to generate PDFs from Java (based partly on recommendations on this
vector<vector<string> > test for example. g++, you can do test.reserve(10); test[0] = othervector; test[9]
I need to find the indexes in the vector based on several boolean predicates.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.