### Generate Planet Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Provides a C# example for generating a Planet barcode using the Spire.Barcode library. The code sets the barcode type to Planet and provides the data. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.Planet; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage(); ``` -------------------------------- ### Generate PDF417 Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Shows how to generate a PDF417 barcode using Spire.Barcode. This example sets the barcode type to Pdf417 and uses Data2D for the input data. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.Pdf417; bs.Data2D = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage().Save("PDF417Code.png"); ``` -------------------------------- ### Generate UPCE Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Provides a C# example for generating a UPCE barcode using the Spire.Barcode library. It configures the barcode type and data, generates the image, and saves it to a PNG file. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.UPCE; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage().Save("UPCECode.png"); ``` -------------------------------- ### Generate Aztec Code in C# Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Provides a C# example for generating an Aztec barcode using the Spire.Barcode library. The code initializes `BarcodeSettings`, sets the type to `Aztec`, and provides the data for the barcode. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.Aztec; bs.Data2D = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage(); ``` -------------------------------- ### Generate ITF6 Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md This example demonstrates generating an ITF6 barcode using the Spire.Barcode library. It involves setting the barcode type to ITF6 and providing the data. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.ITF6; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage(); ``` -------------------------------- ### Generate PDF417 Macro Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md This example demonstrates generating a PDF417 Macro barcode with Spire.Barcode. It sets the barcode type to Pdf417Macro and provides the data for the barcode. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.Pdf417Macro; bs.Data2D = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); Image barcodeImage = bg.GenerateImage(); ``` -------------------------------- ### Generate PDF417 Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Provides an example of generating a PDF417 barcode using Spire.Barcode. It sets the barcode type and data for 2D barcodes. ```vb.net ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to PDF417 bs.Type = BarCodeType.Pdf417 ' Set data for the barcode bs.Data2D = "12345" ' Create barcode generator with the settings Dim bg As New BarCodeGenerator(bs) ' Generate the barcode image bg.GenerateImage() ``` -------------------------------- ### Generate QR Code Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md This example demonstrates generating a QR code using Spire.Barcode. It sets the barcode type to QRCode, provides data to Data2D, generates the image, saves it, and then opens the saved image file. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.QRCode; bs.Data2D= "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage().Save("QRCode.png"); System.Diagnostics.Process.Start("QRCode.png"); ``` -------------------------------- ### Generate RSS Expanded Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Illustrates the process of generating an RSS Expanded barcode using Spire.Barcode in C#. The example sets the barcode type and data, generates the image, and prepares it for saving. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.RSSExpanded; bs.Data = "(12)345678(90)"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage(); ``` -------------------------------- ### Generate Codabar Barcode in C# Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Shows how to generate a Codabar barcode using the Spire.Barcode library in C#. The example sets the barcode type to `Codabar`, provides the data, generates the image, and saves it to a file. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.Codabar; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage().Save("CodabarCode.png"); ``` -------------------------------- ### Generate Code93 Barcode in C# Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Shows a C# example for generating a Code93 barcode using the Spire.Barcode library. The code configures `BarcodeSettings` with the `Code93` type and the data to be encoded. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.Code93; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage(); ``` -------------------------------- ### Generate DataMatrix Barcode in C# Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Provides a C# code snippet for generating a DataMatrix barcode using the Spire.Barcode library. The example sets the barcode type to `DataMatrix`, assigns data to `Data2D`, and saves the generated image. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.DataMatrix; bs.Data2D = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage().Save("DataMatrixCode.png"); ``` -------------------------------- ### Generate RSSLimited Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Generates an RSSLimited barcode using Spire.Barcode. The example sets the barcode type to RSSLimited, provides data, and saves the resulting image. ```vbnet ' Create barcode settings Dim bs As New BarcodeSettings() bs.Type = BarCodeType.RSSLimited bs.Data = "12345" ' Generate barcode and save as image Dim bg As New BarCodeGenerator(bs) bg.GenerateImage().Save("RSSLimitedCode.png") ``` -------------------------------- ### Generate RoyalMail4State Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Generates a RoyalMail4State barcode using Spire.Barcode. This example sets the barcode type and data, then saves the generated image. ```vbnet ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to RoyalMail4State bs.Type = BarCodeType.RoyalMail4State ' Set barcode data bs.Data = "12345" ' Generate barcode and save as image Dim bg As New BarCodeGenerator(bs) bg.GenerateImage().Save("RoyalMail4StateCode.png") ``` -------------------------------- ### Generate MSI Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Provides a C# example for generating an MSI barcode using Spire.Barcode. This code snippet is typically used within an event handler, such as a button click, to create the barcode image. ```csharp private void button1_Click(object sender, EventArgs e) { BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.MSI; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage().Save("MSICode.png"); } ``` -------------------------------- ### Generate ITF14 Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Provides an example of generating an ITF14 barcode using Spire.Barcode, including setting the bearer bar type and saving the image. ```vb.net ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to ITF14 bs.Type = BarCodeType.ITF14 ' Set barcode data bs.Data = "12345" ' Set ITF14 border type to Frame (vertical bar) bs.ITF14BearerBars = ITF14BorderType.Frame ' Alternative: Set ITF14 border type to Bar (horizontal bar) 'bs.ITF14BearerBars = ITF14BorderType.Bar ' Generate barcode image and save Dim bg As New BarCodeGenerator(bs) bg.GenerateImage().Save("ITF14Code.png") ``` -------------------------------- ### Generate OPC Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Demonstrates the generation of an OPC barcode using the Spire.Barcode library. The code sets the barcode type to OPC and provides the data. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.OPC; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage(); ``` -------------------------------- ### Configure and Generate Barcodes in C# Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Demonstrates how to configure barcode settings, generate a barcode image using BarCodeGenerator, and display it in a PictureBox. Includes error handling for the generation process. ```csharp BarcodeSettings bs = new BarcodeSettings(); private void BarcodeDataSetting() { if (this.txtBarcodeData.Text.Length > 0) { bs.Data = this.txtBarcodeData.Text; } else { bs.Data = "12345"; } } private void btnGenerate_Click(object sender, EventArgs e) { BarCodeGenerator BCG = new BarCodeGenerator(bs); try { this.pictureBox1.Image = BCG.GenerateImage(); } catch(Exception ex) { MessageBox.Show(ex.Message); } } ``` -------------------------------- ### Generate RSS14 Truncated Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Provides a C# example for generating an RSS14 Truncated barcode with Spire.Barcode. The code configures the barcode settings, generates the image, and stores it in a variable. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.RSS14Truncated; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); Image barcodeImage = bg.GenerateImage(); ``` -------------------------------- ### Generate Code25 Barcode in C# Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md This example shows how to create a Code25 barcode using the Spire.Barcode library in C#. It involves setting up `BarcodeSettings` with the `Code25` type and the relevant data, then generating the barcode image. ```csharp // Create barcode settings BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.Code25; bs.Data = "12345"; // Generate barcode BarCodeGenerator bg = new BarCodeGenerator(bs); Image barcodeImage = bg.GenerateImage(); ``` -------------------------------- ### Generate EAN8 Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md This example shows how to generate an EAN8 barcode using the Spire.Barcode library in C#. It sets the barcode type to EAN8 and provides the necessary data. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.EAN8; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage().Save("EAN8Code.png"); ``` -------------------------------- ### Generate EAN13 Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Provides an example of generating an EAN13 barcode with Spire.Barcode. The code sets the barcode type, data, and saves the generated image. ```vb.net ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to EAN13 bs.Type = BarCodeType.EAN13 ' Set barcode data bs.Data = "12345" ' Create barcode generator Dim bg As New BarCodeGenerator(bs) ' Generate and save barcode image bg.GenerateImage().Save("EAN13Code.png") ``` -------------------------------- ### Generate SSCC18 Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Provides a C# example for generating an SSCC18 barcode with Spire.Barcode. The code sets the barcode type and data, generates the image, and saves it to a PNG file. ```csharp // Create barcode settings BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.SSCC18; bs.Data = "12345"; // Generate barcode image BarCodeGenerator bg = new BarCodeGenerator(bs); Image barcodeImage = bg.GenerateImage(); barcodeImage.Save("SSCC18Code.png"); ``` -------------------------------- ### Generate PZN Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Demonstrates how to generate a PZN barcode using the Spire.Barcode library. It involves setting the barcode type to PZN and providing the data. ```vbnet ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to PZN bs.Type = BarCodeType.PZN ' Set barcode data bs.Data = "12345" ' Create barcode generator with settings Dim bg As New BarCodeGenerator(bs) ' Generate barcode image bg.GenerateImage() ``` -------------------------------- ### Generate PostNet Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Demonstrates how to generate a PostNet barcode using Spire.Barcode. This involves creating barcode settings, setting the type to PostNet, providing the data, and then generating the barcode image. ```csharp // Create barcode settings BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.PostNet; bs.Data = "12345"; // Generate barcode BarCodeGenerator bg = new BarCodeGenerator(bs); Image barcodeImage = bg.GenerateImage(); ``` -------------------------------- ### Generate PZN Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Shows how to generate a PZN barcode using the Spire.Barcode library. The code sets the barcode type to PZN and provides the data for the barcode generation. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.PZN; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage(); ``` -------------------------------- ### Generate SwissPostParcel Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Provides an example of generating a SwissPostParcel barcode with the Spire.Barcode library. The process includes setting up BarcodeSettings, specifying the SwissPostParcel type, inputting data, creating a BarCodeGenerator, and saving the generated image to a file. ```vbnet ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to SwissPostParcel bs.Type = BarCodeType.SwissPostParcel ' Set barcode data bs.Data = "12345" ' Create barcode generator with settings Dim bg As New BarCodeGenerator(bs) ' Generate and save the barcode image bg.GenerateImage().Save("SwissPostParcelCode.png") ``` -------------------------------- ### Generate Planet Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Generates a Planet barcode using Spire.Barcode. This requires setting the barcode type to Planet and providing the data. ```vbnet ' Create barcode settings Dim bs As New BarcodeSettings() bs.Type = BarCodeType.Planet bs.Data = "12345" ' Generate barcode image Dim bg As New BarCodeGenerator(bs) bg.GenerateImage() ``` -------------------------------- ### Generate UPCE Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Shows how to create a UPCE barcode using the Spire.Barcode library. The steps include setting up BarcodeSettings, defining the barcode type as UPCE, entering the data, and generating the barcode image. ```vbnet ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to UPCE bs.Type = BarCodeType.UPCE ' Set barcode data bs.Data = "12345" ' Create barcode generator Dim bg As New BarCodeGenerator(bs) ' Generate barcode image bg.GenerateImage() ``` -------------------------------- ### Generate Deutsche Post Leitcode Barcode in C# Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md This C# example demonstrates generating a Deutsche Post Leitcode barcode using the Spire.Barcode library. It sets the barcode type, provides the data, saves the image, and then attempts to open the saved image file. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.DeutschePostLeitcode; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage().Save("DeutschePostLeitcodeCode.png"); System.Diagnostics.Process.Start("DeutschePostLeitcodeCode.png"); ``` -------------------------------- ### Spire.Barcode VB.NET Barcode Generation and Scanning Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md This comprehensive example showcases advanced barcode generation and scanning using Spire.Barcode in VB.NET. It covers dynamic configuration of barcode properties like type, data, text display, borders, fonts, alignment, colors, rotation, and dimensions. It also includes functionality to scan a barcode from an image. ```vbnet ' Barcode settings initialization Private bs As New BarcodeSettings() ' Set barcode type Dim barcodeType As String = Me.lbBarcodeType.SelectedItem.ToString() bs.Type = CType(System.Enum.Parse(GetType(BarCodeType), barcodeType), BarCodeType) ' Set barcode data If Me.txtBarcodeData.Text.Length > 0 Then bs.Data = Me.txtBarcodeData.Text Else bs.Data = "12345" End If ' Configure text display settings If ckShowText.Checked Then bs.ShowText = True Else bs.ShowText = False End If If cKShowTextOnBottom.Checked Then bs.ShowTextOnBottom = True Else bs.ShowTextOnBottom = False End If ' Configure top text settings If ckShowTopText.Checked Then bs.ShowTopText = True Else bs.ShowTopText = False End If ' Configure border settings If cKBorder.Checked Then bs.HasBorder = True bs.BorderColor = ccbBorderColor.SelectColor bs.BorderWidth = Single.Parse(Me.txtBorderWidth.Text) Else bs.HasBorder = False End If ' Configure text font bs.TextFont = New Font(Me.cbbFontName.SelectedItem.ToString(), Single.Parse(Me.cBFontSize.SelectedItem.ToString()), bs.TextFont.Style) ' Configure text alignment Dim textAlignment As String = Me.cBAlignment.SelectedItem.ToString() bs.TextAlignment = CType(System.Enum.Parse(GetType(StringAlignment), textAlignment), StringAlignment) ' Configure top text font bs.TopTextFont = New Font(Me.cBTopTextFontName.SelectedItem.ToString(), Single.Parse(Me.cBTopTextFontSize.SelectedItem.ToString()), bs.TopTextFont.Style) ' Configure top text alignment Dim topTextAlignment As String = Me.cBTopTextAlignment.SelectedItem.ToString() bs.TopTextAligment = CType(System.Enum.Parse(GetType(StringAlignment), topTextAlignment), StringAlignment) ' Configure colors bs.TopTextColor = Me.ccbTopTextFontColor.SelectColor bs.ForeColor = Me.ccbBarColor.SelectColor bs.BackColor = Me.ccbBackgroundColor.SelectColor bs.TextColor = Me.cBFontColor.SelectColor ' Configure rotation If rBNone.Checked Then bs.Rotate = 0 ElseIf rBNine.Checked Then bs.Rotate = 90 ElseIf rBEight.Checked Then bs.Rotate = 180 ElseIf rBTwoSeven.Checked Then bs.Rotate = 270 End If ' Configure DPI bs.DpiX = CSng(Me.nudDpi.Value) bs.DpiY = CSng(Me.nudDpi.Value) ' Configure bar dimensions bs.BarHeight = Single.Parse(txtBarHeight.Text) bs.X = Single.Parse(txtBarWidth.Text) ' Generate barcode image Dim BCG As New BarCodeGenerator(bs) Me.pictureBox1.Image = BCG.GenerateImage() ' Scan barcode from image Dim scanResult As String = BarcodeScanner.ScanOne(TryCast(Me.pictureBox2.Image, Bitmap)) Me.txtScanResult.Text = scanResult ``` -------------------------------- ### Generate Code93Extended Barcode in C# Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md This example demonstrates generating a Code93Extended barcode in C# using the Spire.Barcode library. It sets the barcode type to `Code93Extended` and provides the data for the barcode. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.Code93Extended; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage(); ``` -------------------------------- ### Generate EAN14 Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Provides a C# example for generating an EAN14 barcode with Spire.Barcode. This code snippet shows how to set the barcode type to EAN14 and configure bearer bars (frame or bar). ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.EAN14; bs.Data = "12345"; //vertical bar bs.ITF14BearerBars = ITF14BorderType.Frame; //horizontal bar //bs.ITF14BearerBars = ITF14BorderType.Bar; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage().Save("ITF14Code.png"); ``` -------------------------------- ### VB.NET Codabar Barcode Generation Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Generates a Codabar barcode using the Spire.Barcode library with specified data. ```vb.net Dim bs As New BarcodeSettings() bs.Type = BarCodeType.Codabar bs.Data = "12345" Dim bg As New BarCodeGenerator(bs) bg.GenerateImage() ``` -------------------------------- ### Generate RSS14 Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Shows how to create an RSS14 barcode using the Spire.Barcode library. It involves setting the barcode type and data, then generating the barcode image. ```csharp // Create barcode settings BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.RSS14; bs.Data = "12345"; // Generate barcode BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage(); ``` -------------------------------- ### Generate PDF417Macro Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Generates a PDF417Macro barcode using Spire.Barcode. It involves setting the barcode type to Pdf417Macro and providing the data. ```vbnet ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to PDF417Macro bs.Type = BarCodeType.Pdf417Macro ' Set the data for the barcode bs.Data2D = "12345" ' Create barcode generator with the settings Dim bg As New BarCodeGenerator(bs) ' Generate the barcode image bg.GenerateImage() ``` -------------------------------- ### Generate Code39Extended Barcode in C# Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md This C# example illustrates how to generate a Code39Extended barcode with the Spire.Barcode library. It sets the barcode type to `Code39Extended`, assigns data, generates the image, and saves it to a file. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.Code39Extended; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage().Save("Code39ExtendedCode.png"); ``` -------------------------------- ### Generate Code39 Barcode in C# Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Demonstrates the generation of a Code39 barcode using C# and the Spire.Barcode library. The code sets the barcode type to `Code39` and provides the data string for encoding. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.Code39; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); Image barcodeImage = bg.GenerateImage(); ``` -------------------------------- ### Generate EAN13 Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Demonstrates how to generate an EAN13 barcode using the Spire.Barcode library. It includes setting the barcode type to EAN13 and providing the data for the barcode. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.EAN13; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage(); ``` -------------------------------- ### Generate Code128 Barcode in C# Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Illustrates how to generate a Code128 barcode with specific settings in C# using Spire.Barcode. The example sets the barcode type to `Code128`, specifies the data, and configures the `Code128SetMode` to `Auto` before saving the generated image. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.Code128; bs.Data = "12345"; bs.Code128SetMode = Code128SetMode.Auto; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage().Save("Code128Code.png"); ``` -------------------------------- ### Scan Barcodes from Image Files in C# Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Shows how to open an image file using OpenFileDialog, display it in a PictureBox, and scan a barcode from the image using BarcodeScanner. The scanned data is then displayed in a text box. ```csharp private void btnScan_Click(object sender, EventArgs e) { OpenFileDialog openDia = new OpenFileDialog(); openDia.Filter = "Bitmap Image(*.bmp)|*.bmp|JPEG Image(*.jpg)|*.jpg|PNG Image(*.png)|*.png"; if (openDia.ShowDialog() == DialogResult.OK) { this.pictureBox2.Image = Image.FromFile(openDia.FileName); string scanResult = BarcodeScanner.ScanOne(openDia.FileName); this.txtScanResult.Text = scanResult; } } ``` -------------------------------- ### Generate Singapore Post 4-State Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Demonstrates the generation of a Singapore Post 4-State barcode using Spire.Barcode. The code configures the barcode type and data, then generates the image. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.SingaporePost4State; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage(); ``` -------------------------------- ### Generate UPCA Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Illustrates the process of generating a UPCA barcode using the Spire.Barcode library. This involves initializing BarcodeSettings, setting the type to UPCA, providing the barcode data, and then generating the barcode image. ```vbnet ' Create barcode settings Dim bs As New BarcodeSettings() bs.Type = BarCodeType.UPCA bs.Data = "12345678901" ' Generate barcode Dim bg As New BarCodeGenerator(bs) Dim barcodeImage = bg.GenerateImage() ``` -------------------------------- ### Generate ITF6 Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Shows how to generate an ITF6 barcode using Spire.Barcode. The code sets the barcode type and data. ```vb.net ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to ITF6 bs.Type = BarCodeType.ITF6 ' Set barcode data bs.Data = "12345" ' Create barcode generator with settings Dim bg As New BarCodeGenerator(bs) ' Generate barcode image bg.GenerateImage() ``` -------------------------------- ### Generate PostNet Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Generates a PostNet barcode using Spire.Barcode. The process includes setting the barcode type to PostNet and specifying the data. ```vbnet ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to PostNet bs.Type = BarCodeType.PostNet ' Set barcode data bs.Data = "12345" ' Create barcode generator with the settings Dim bg As New BarCodeGenerator(bs) ' Generate the barcode image bg.GenerateImage() ``` -------------------------------- ### Generate UPCA Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Demonstrates generating a UPCA barcode using Spire.Barcode in C#. The code sets the barcode type and data, generates the image, and saves it to a file. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.UPCA; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage().Save("UPCACode.png"); ``` -------------------------------- ### VB.NET Code25 Barcode Generation Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Generates a Code25 barcode using the Spire.Barcode library with specified data. ```vb.net Dim bs As New BarcodeSettings() bs.Type = BarCodeType.Code25 bs.Data = "12345" Dim bg As New BarCodeGenerator(bs) bg.GenerateImage() ``` -------------------------------- ### Generate QR Code Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Shows how to generate a QR code using Spire.Barcode. The barcode type is set to QRCode and data is provided via Data2D, with the output saved as a PNG file. ```vbnet Dim bs As New BarcodeSettings() bs.Type = BarCodeType.QRCode bs.Data2D = "12345" Dim bg As New BarCodeGenerator(bs) bg.GenerateImage().Save("QRCode.png") ``` -------------------------------- ### VB.NET Aztec Code Generation Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Generates an Aztec Code barcode with specific data and saves the resulting image to a file. ```vb.net ' Create barcode settings Dim bs As New BarcodeSettings() bs.Type = BarCodeType.Aztec bs.Data2D = "12345" ' Generate barcode image Dim bg As New BarCodeGenerator(bs) bg.GenerateImage().Save("AztecCode.png") ``` -------------------------------- ### Generate MSI Code Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Demonstrates generating an MSI barcode using Spire.Barcode in VB.NET. It involves setting the barcode type and data. ```vb.net ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to MSI bs.Type = BarCodeType.MSI ' Set barcode data bs.Data = "12345" ' Create barcode generator with the settings Dim bg As New BarCodeGenerator(bs) ' Generate the barcode image bg.GenerateImage() ``` -------------------------------- ### Generate OPC Code Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Shows how to generate an OPC barcode using Spire.Barcode in VB.NET. The code sets the barcode type and data. ```vb.net ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to OPC bs.Type = BarCodeType.OPC ' Set barcode data bs.Data = "12345" ' Create barcode generator with settings Dim bg As New BarCodeGenerator(bs) ' Generate barcode image Dim barcodeImage As Image = bg.GenerateImage() ``` -------------------------------- ### Generate SSCC18 Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md This section is intended for SSCC18 barcode generation using Spire.Barcode, but the code snippet is missing. -------------------------------- ### Generate Interleaved 2 of 5 Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Demonstrates the generation of an Interleaved 2 of 5 barcode using Spire.Barcode. The code sets the barcode type to Interleaved25 and provides the data. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.Interleaved25; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage(); ``` -------------------------------- ### Generate SCC14 Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Shows how to generate an SCC14 barcode using Spire.Barcode. The code sets the barcode type and data, generates the image, and saves it to a PNG file. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.SCC14; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage().Save("SCC14Code.png"); ``` -------------------------------- ### Extract Barcode Information from Image (.NET) Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Demonstrates how to load a barcode image, scan it using Spire.Barcode, and extract details such as the barcode type, vertex coordinates, and the decoded data string. It iterates through the scanned results to retrieve the information. ```vbnet ' Load barcode image Dim barcodeInfos() As BarcodeInfo = BarcodeScanner.ScanInfo("..\..\..\..\..\Data\GetBarcodeInfo.png") Dim point As String = "" Dim dataString As String = "" Dim vertexes() As Point = Nothing Dim barCodeReadType As BarCodeReadType = 0 ' Get barcode information For Each barcodeInfo As BarcodeInfo In barcodeInfos barCodeReadType = barcodeInfo.BarCodeReadType vertexes = barcodeInfo.Vertexes dataString = barcodeInfo.DataString Next barcodeInfo ' Get vertexes For i As Integer = 0 To vertexes.Length - 1 point &= vertexes(i).ToString() Next i ``` -------------------------------- ### Extract Barcode Information from Image in C# Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Demonstrates how to extract detailed information about barcodes present in an image file using BarcodeScanner.ScanInfo. It retrieves the barcode type, vertex coordinates, and data string. ```csharp // Load barcode image BarcodeInfo[] barcodeInfos = BarcodeScanner.ScanInfo(@"..\..\..\..\..\Data\GetBarcodeInfo.png"); string point = ""; string dataString = ""; Point[] vertexes = null; BarCodeReadType barCodeReadType = 0; // Get barcode information foreach (BarcodeInfo barcodeInfo in barcodeInfos) { barCodeReadType = barcodeInfo.BarCodeReadType; vertexes = barcodeInfo.Vertexes; dataString = barcodeInfo.DataString; } // Get vertexes for (int i = 0; i < vertexes.Length; i++) { point += vertexes[i].ToString(); } ``` -------------------------------- ### Generate SingaporePost4State Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Generates a SingaporePost4State barcode using Spire.Barcode. The barcode type is set to SingaporePost4State, data is provided, and the image is generated. ```vbnet ' SingaporePost4State barcode generation Dim bs As New BarcodeSettings() bs.Type = BarCodeType.SingaporePost4State bs.Data = "12345" Dim bg As New BarCodeGenerator(bs) bg.GenerateImage() ``` -------------------------------- ### Generate QR Code with Logo in C# Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Demonstrates how to generate a QR code with a logo image using the Spire.Barcode library. It involves setting barcode type to QRCode, configuring data mode and error correction level, and assigning a logo image to be embedded. ```csharp BarcodeSettings barCodeSetting = new BarcodeSettings(); barCodeSetting.Type = BarCodeType.QRCode; barCodeSetting.BackColor = Color.WhiteSmoke; barCodeSetting.QRCodeDataMode = QRCodeDataMode.Byte; barCodeSetting.QRCodeECL = QRCodeECL.M; barCodeSetting.ShowTextOnBottom = true; string data = "ABC 123456789"; barCodeSetting.Data2D = data; barCodeSetting.Data = data; barCodeSetting.QRCodeLogoImage = Image.FromFile(@"..\..\..\..\..\..\..\Data\Logo.png"); BarCodeGenerator generator = new BarCodeGenerator(barCodeSetting); Image barcode = generator.GenerateImage(); ``` -------------------------------- ### Generate EAN128 Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Shows how to generate an EAN128 barcode using the Spire.Barcode library. This includes setting the barcode type and data. ```vb.net ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to EAN128 bs.Type = BarCodeType.EAN128 ' Set barcode data bs.Data = "12345" ' Generate barcode Dim bg As New BarCodeGenerator(bs) bg.GenerateImage() ``` -------------------------------- ### Save Generated Barcodes in C# Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Illustrates how to save a generated barcode image to a file using SaveFileDialog. The user can choose the file format (BMP, JPG, PNG). ```csharp private void tSBSaveBarcode_Click(object sender, EventArgs e) { BarCodeGenerator bcg = new BarCodeGenerator(bs); SaveFileDialog sf = new SaveFileDialog(); sf.Filter = "Bitmap Image(*.bmp)|*.bmp|JPEG Image(*.jpg)|*.jpg|PNG Image(*.png)|*.png"; if (sf.ShowDialog() == DialogResult.OK) { bcg.GenerateImage().Save(sf.FileName); } } ``` -------------------------------- ### Generate RSS Limited Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md This C# code snippet demonstrates how to generate an RSS Limited barcode using the Spire.Barcode library. It configures the barcode type and data, then generates the image. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.RSSLimited; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage(); ``` -------------------------------- ### Generate EAN14 Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Illustrates the process of generating an EAN14 barcode using Spire.Barcode. It involves configuring the barcode settings and generating the image. ```vb.net ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to EAN14 bs.Type = BarCodeType.EAN14 ' Set barcode data bs.Data = "12345" ' Create barcode generator Dim bg As New BarCodeGenerator(bs) ' Generate barcode image bg.GenerateImage() ``` -------------------------------- ### Generate RSS14 Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Demonstrates the generation of an RSS14 barcode using Spire.Barcode. The barcode type is set to RSS14, data is provided, and the image is saved. ```vbnet ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to RSS14 bs.Type = BarCodeType.RSS14 ' Set barcode data bs.Data = "12345" ' Create barcode generator with the settings Dim bg As New BarCodeGenerator(bs) ' Generate and save the barcode image bg.GenerateImage().Save("RSS14Code.png") ``` -------------------------------- ### Generate Code11 Barcode in C# Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md This C# code snippet demonstrates the generation of a Code11 barcode using the Spire.Barcode library. It configures the `BarcodeSettings` with the `Code11` type and the data to be encoded. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.Code11; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage(); ``` -------------------------------- ### Generate Swiss Post Parcel Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Shows how to generate a Swiss Post Parcel barcode using Spire.Barcode. The code configures the barcode type and data, then generates the image. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.SwissPostParcel; bs.Data = "12345"; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage(); ``` -------------------------------- ### VB.NET DeutschePost Identcode Generation Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Generates a DeutschePost Identcode barcode using the Spire.Barcode library. It sets the barcode type accordingly. ```vb.net ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to DeutschePost Identcode bs.Type = BarCodeType.DeutschePostIdentcode ' Create barcode generator with the settings Dim bg As New BarCodeGenerator(bs) ``` -------------------------------- ### VB.NET DeutschePost Leitcode Generation Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Generates a DeutschePost Leitcode barcode using the Spire.Barcode library. It sets the barcode type accordingly. ```vb.net ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to DeutschePost Leitcode bs.Type = BarCodeType.DeutschePostLeitcode ' Create barcode generator with the settings Dim bg As New BarCodeGenerator(bs) ' Generate barcode image bg.GenerateImage() ``` -------------------------------- ### Generate Deutsche Post Leitcode Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Demonstrates how to generate a Deutsche Post Leitcode barcode using Spire.Barcode. It involves setting the barcode type and data. ```vb.net Dim bs As New BarcodeSettings() bs.Type = BarCodeType.DeutschePostLeitcode bs.Data = "12345" Dim bg As New BarCodeGenerator(bs) bg.GenerateImage() ``` -------------------------------- ### Generate ITF14 Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Shows how to generate an ITF14 barcode with bearer bars using Spire.Barcode. The code sets the barcode type to ITF14 and specifies the bearer bar type. ```csharp BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.ITF14; bs.Data = "12345"; //vertical bar bs.ITF14BearerBars = ITF14BorderType.Frame; //horizontal bar //bs.ITF14BearerBars = ITF14BorderType.Bar; BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage().Save("ITF14Code.png"); ``` -------------------------------- ### VB.NET Code39 Barcode Generation Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Generates a Code39 barcode using the Spire.Barcode library. It sets the barcode type to Code39 and encodes the provided data. ```vb.net ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to Code39 bs.Type = BarCodeType.Code39 ' Set barcode data bs.Data = "12345" ' Create barcode generator Dim bg As New BarCodeGenerator(bs) ' Generate barcode image Dim barcodeImage As Image = bg.GenerateImage() ``` -------------------------------- ### Generate USPS Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/CS-Examples/barcode_cs.md Shows how to generate a USPS barcode using Spire.Barcode in C#. The code sets the barcode type and data, generates the image, and saves it to a PNG file. ```csharp // Create barcode settings BarcodeSettings bs = new BarcodeSettings(); bs.Type = BarCodeType.USPS; bs.Data = "12345"; // Generate barcode and save as image BarCodeGenerator bg = new BarCodeGenerator(bs); bg.GenerateImage().Save("USPSCode.png"); ``` -------------------------------- ### VB.NET Code11 Barcode Generation Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Generates a Code11 barcode using the Spire.Barcode library. It sets the barcode type to Code11 and encodes the provided data. ```vb.net ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to Code11 bs.Type = BarCodeType.Code11 ' Set the data to be encoded bs.Data = "12345" ' Create barcode generator with the settings Dim bg As New BarCodeGenerator(bs) ' Generate barcode image bg.GenerateImage() ``` -------------------------------- ### VB.NET Code93 Barcode Generation Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Generates a Code93 barcode using the Spire.Barcode library. It sets the barcode type to Code93 and encodes the provided data. ```vb.net ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to Code93 bs.Type = BarCodeType.Code93 ' Set barcode data bs.Data = "12345" ' Create barcode generator with settings Dim bg As New BarCodeGenerator(bs) ' Generate barcode image bg.GenerateImage() ``` -------------------------------- ### Generate USPS Barcode Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Demonstrates the generation of a USPS barcode using the Spire.Barcode library in VB.NET. It covers setting the barcode type to USPS, providing the necessary data, and creating the barcode image. ```vbnet ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to USPS bs.Type = BarCodeType.USPS ' Set barcode data bs.Data = "12345" ' Create barcode generator with settings Dim bg As New BarCodeGenerator(bs) ' Generate barcode image bg.GenerateImage() ``` -------------------------------- ### VB.NET DataMatrix Barcode Generation Source: https://github.com/eiceblue/spire.barcode-for-.net/blob/master/VB-Examples/barcode_vb.md Generates a DataMatrix barcode using the Spire.Barcode library. It sets the barcode type to DataMatrix and encodes the provided 2D data. ```vb.net ' Create barcode settings Dim bs As New BarcodeSettings() ' Set barcode type to DataMatrix bs.Type = BarCodeType.DataMatrix ' Set the data for the barcode bs.Data2D = "12345" ' Create barcode generator with the settings Dim bg As New BarCodeGenerator(bs) ' Generate the barcode image bg.GenerateImage() ```