I am using Spire.Barcode version 3.5. I have a WPF C# application that continuously creates barcodes (10's of thousands of barcodes in a row). Every once in a while, a Barcode image seems to be corrupted. Attached is an example of a "corrupted" barcode. It almost looks like distorted text with a little barcode at the bottom.
Because I need to create these barcodes quickly, I am using multiple threads to create these barcodes. Is this library multi-thread safe?
Also, I am thinking about updating the library to 4.1 to try to fix this issue. Will my old license still work with the update? Will I need to do anything to my program to accommodate this update?
Here is an example of how I am creating the barcode:
- Code: Select all
BarcodeSettings bs = new BarcodeSettings();
switch (barcodeType)
{
case "Code 128":
bs.Type = BarCodeType.Code128;
break;
case "UPCA":
bs.Type = BarCodeType.UPCA;
break;
case "EAN 128":
bs.Type = BarCodeType.EAN128;
break;
}
bs.Data = data;
bs.ResolutionType = ResolutionType.UseDpi;
bs.DpiX = downwebDPI;
bs.DpiY = 1200;
bs.Unit = GraphicsUnit.Pixel;
bs.AutoResize = true;
bs.BarHeight = intheight;
bs.ShowText = false;
BarCodeGenerator bg = new BarCodeGenerator(bs);
System.Drawing.Image image = bg.GenerateImage();