barcodelib icon indicating copy to clipboard operation
barcodelib copied to clipboard

After Update, It doesnt work.

Open sraban75 opened this issue 2 years ago • 2 comments

This is My old code. and it works fine, but after upgrading from 2.4 to 3.0, It doesn't work

var barcode = new Barcode(); barcode.ImageFormat = ImageFormat.Png; barcode.IncludeLabel = includeLabel; using var image = barcode.Encode(TYPE.CODE128, code); await using var m = new MemoryStream(); image.Save(m, ImageFormat.Png); var imageBytes = m.ToArray();

sraban75 avatar May 29 '23 18:05 sraban75

Try #156

kzimny avatar May 30 '23 12:05 kzimny

 BarcodeStandard.Barcode barcode = new BarcodeStandard.Barcode();
 barcode.IncludeLabel = includeLabel;
 barcode.EncodedType = BarcodeStandard.Type.Code128;
 barcode.Encode(BarcodeStandard.Type.Code128, code);

You can try to save the image directly through the package instead of doing all this with memorystream

barcode.SaveImage(path, BarcodeStandard.SaveTypes.Png);

dorathoto avatar Sep 15 '23 13:09 dorathoto

Going to close this as resolved as saving is provided through the lib as pointed out by @dorathoto

barnhill avatar Apr 29 '24 03:04 barnhill