Skip to main content
All docs
V26.1
  • Industrial2of5OptionsBuilder Class

    Builds an Industrial2of5Options object. Chain builder methods to configure barcode settings, then call the Build method to create the options object.

    Namespace: DevExpress.Docs.Barcode

    Assembly: DevExpress.Docs.Core.v26.1.dll

    Declaration

    public class Industrial2of5OptionsBuilder :
        BarcodeOptionsBuilder<Industrial2of5Options, Industrial2of5OptionsBuilder>

    Remarks

    The following code snippet creates the Industrial 2 of 5 barcode and customizes its options:

    DevExpress Barcode Generator - Industrial 2 of 5 barcode

    using DevExpress.Docs.Barcode;
    using DevExpress.Drawing;
    using System.Drawing;
    
    var industrialOptions = Industrial2of5OptionsBuilder.Create()
        .WithCalculateChecksum(true)
        .WithWideNarrowRatio(3)
        .WithBackColor(Color.LightGray)
        .WithShowText(false)
        .WithPadding(5)
        .WithBorderWidth(1)
        .WithBorderColor(Color.Blue)
        .Build();
    
    var filePath = Path.GetFullPath("2of5_barcode.png");
    {
        using var stream = new FileStream(filePath, FileMode.Create);
        using var generator = new BarcodeGenerator(industrialOptions);
        generator.Export("12345", stream, DXImageFormat.Png);
    }
    
    See Also