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"); } } }