QR Code Image Sample - pqScan.com
C#, VB.NET UPC-A Creator Encoding UPC-A Barcode Image in C# and VB.NET Online Demo Download Trial Purchase Now

How to Generate UPC-A in C# and VB.NET

back to home  >  .NET Barcode Generator SDK  >  Generate Barcodes in C# & VB.NET  >  Generate UPC-A in C# & VB.NET

C# and VB.NET UPC-A Creator is one of the generation functions in pqScan Barcode Creator for .NET. It allows developers to use C# and VB.NET code to generate UCP-A barcode in any .NET application, making UPC-A in .NET WinForms and drawing UPC-A in ASP.NET web applications are both supported excellent.

In this tutorial, we will introduce you how to generate UPC-A in Console application using C#/VB.NET language.

Encode and createUPC-A - C Sharp sample

The first example shows you how to make UPC-A barcode image using C# code. The most useful propertieshave been lifted, you can make customized barcode image by resetting them.

For more help, generating EAN-13 in C# and creating Data Matrix in C# are supplied.

using System;
using System.Drawing;
using System.Drawing.Imaging;
using PQScan.BarcodeCreator;

namespaceUPCAGeneratorInCSharp
{
    classProgram
    {
        staticvoid Main(string[] args)
        {
            //Create an instance of PQScan.BarcodeCreator.Barcode object.
            Barcode upca = new Barcode();
            //Set barcode date to encode
            upca.Data = "123456789012";
            //Set barcode type
            upca.BarType = BarCodeType.UPCA;
            //Set barcode image width
            upca.Width = 300;
            //Set barcode image height
            upca.Height = 100;
            //Set 1d barcode human-readable text to display
            upca.ShowText = true;           
            //Set barcode image fore groud color
            upca.BarcodeColor = Color.Black;
            //Set barcode image back ground color
            upca.BackgroundColor = Color.White;
            //Set barcode image format
            upca.PictureFormat = ImageFormat.Png;
            //Save barcode image to file
            upca.CreateBarcode("upca-csharp.png");
        }
    }
}

Make and generate UPC-A - Visual Basic sample

It's not hard to draw UPC-A barcode image in VB.NET. Look at the following sample code, it will lend a hand to you.

For more help, printing QR Code in VB.NET and encoding PDF417 in VB.NET are supported.

Imports System.Drawing
Imports System.Drawing.Imaging
Imports PQScan.BarcodeCreator

Namespace UPCAGeneratorInVB
    Class Program
        Private Shared Sub Main(args As String())

            'Create an instance of PQScan.BarcodeCreator.Barcode object.
            Dim upca As New Barcode()
            'Set barcode date to encode
            upca.Data = "123456789012"
            'Set barcode type
            upca.BarType = BarCodeType.UPCA
            'Set barcode image width
            upca.Width = 300
            'Set barcode image height
            upca.Height = 100
            'Set 1d barcode human-readable text to display
            upca.ShowText = True
            'Set barcode image fore groud color
            upca.BarcodeColor = Color.Black
            'Set barcode image back ground color
            upca.BackgroundColor = Color.White
            'Set barcode image format
            upca.PictureFormat = ImageFormat.Png
            'Save barcode image to file
            upca.CreateBarcode("upca-vb.png")
        End Sub
    End Class
End Namespace

generate upca in c#/vb.net

.NET Barcode Creator QR Code Creator in C#/VB Data Matrix Creator in C#/VB PDF 417 Creator in C#/VB Aztec Creator in C#/VB EAN 13 Creator in C#/VB EAN 8 Creator in C#/VB Code 128 Creator in C#/VB Code 39 Creator in C#/VB