[C #] BarcodeLib,

Source: Internet
Author: User

[C #] BarcodeLib,
BarcodeLib-a streamlined and elegant library for generating bar code

 

Introduction

When Baidu searches for similar keywords such as "C # barcode", it basically uses the ZXing class library to generate the barcode. Today, I am introducing another class library Barcode, which together witness its strength.

But she suddenly thought her boyfriend was learning C. Only programmers who want to learn C # have such high awareness. C # is one of the most widely used network programming languages. It is simple, object-oriented, stable, platform-independent, and multithreading, dynamic. Students who want to learn C # are of excellent quality, have a strong awareness of the Integration of erudition and elegance, and have strong psychological endurance, humanistic feelings, and leadership qualities. They are all good assistants of teachers, A good partner of students. C # is selected successfully! (From the Internet)

 

Official introduction
  • Easily generate bar codes in ASP. NET, Windows, Reporting Service, Crystal Reports, and RDLC Reports applications
  • Generate accurate bar code images and save them as JPEG, GIF, or PNG image files in C # and VB. NET classes.
  • Compatible with C # and VB. NET
  • Widely used by. NET programmers
  • Complies with the latest bar code symbol system standards, such as ISO/IEC, GS1
  • Create linear bar codes, including Code39, Code128, GS1-128, Interleaved 2 of 5, EAN/UPC
  • Create 2d barcode images including data matrices, PDF-417 and QR codes

 

Nuget Installation

Public enum TYPE {UNSPECIFIED = 0, UPCA = 1, UPCE = 2, UPC_SUPPLEMENTAL_2DIGIT = 3, priority = 4, EAN13 = 5, EAN8 = 6, Interleaved2of5 = 7, Standard2of5 = 8, industrial2of5 = 9, CODE39 = 10, CODE39Extended = 11, CODE39_Mod43 = 12, Codabar = 13, PostNet = 14, BOOKLAND = 15, ISBN = 16, JAN13 = 17, MSI_Mod10 = 18, MSI_2Mod10 = 19, MSI_Mod11 = 20, MSI_Mod11_Mod10 = 21, Modified_Plessey = 22, CODE11 = 23, USD8 = 24, UCC12 = 25, UCC13 = 26, LOGMARS = 27, CODE128 = 28, CODE128A = 29, CODE128B = 30, CODE128C = 31, ITF14 = 32, CODE93 = 33, TELEPEN = 34, FIM = 35, PHARMACODE = 36}

 

Easy to use

Barcode is the core class. It has three constructors and implements the IDisposable interface. Therefore, we should use the uisng keyword to release resources after execution.

        public Barcode();        public Barcode(string data);        public Barcode(string data, TYPE iType);

 

Encode () is a method used for encoding operations. After the call is completed, a bitmap is generated.

        public Image Encode(TYPE iType, string StringToEncode);        public Image Encode(TYPE iType, string StringToEncode, Color ForeColor, Color BackColor);        public Image Encode(TYPE iType, string StringToEncode, int Width, int Height);        public Image Encode(TYPE iType, string StringToEncode, Color ForeColor, Color BackColor, int Width, int Height);

 

Of course, it also comes with the corresponding SaveImage method saved to the file.

        public void SaveImage(string Filename, SaveTypes FileType);        public void SaveImage(Stream stream, SaveTypes FileType);

 

Supported file types by default:

    public enum SaveTypes    {        JPG = 0,        BMP = 1,        PNG = 2,        GIF = 3,        TIFF = 4,        UNSPECIFIED = 5    }

 

This is a simple usage:

/// <Summary> /// generate a barcode /// </summary> /// <param name = "content"> content </param> /// <returns> </returns> public static Image GenerateBarCodeBitmap (string content) {using (var barcode = new Barcode () {IncludeLabel = true, Alignment = AlignmentPositions. CENTER, Width = 250, Height = 100, RotateFlipType = RotateFlipType. rotateNoneFlipNone, BackColor = Color. white, ForeColor = Color. black,}) {return barcode. encode (TYPE. CODE128B, content );}}

[Note] I assigned true values to the delabel attribute. If no parameter is specified, only the bar code can be generated without displaying data at the bottom.

[Blogger] Anti-Bot

Http://www.cnblogs.com/liqingwen/p/6876392.html.

Https://www.codeproject.com/Articles/20823/Barcode-Image-Generation-Library (reference)

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.