Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After Update, It doesnt work. #157

Closed
sraban75 opened this issue May 29, 2023 · 3 comments
Closed

After Update, It doesnt work. #157

sraban75 opened this issue May 29, 2023 · 3 comments
Assignees
Labels

Comments

@sraban75
Copy link

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();

@kzimny
Copy link

kzimny commented May 30, 2023

Try #156

@dorathoto
Copy link
Contributor

 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);

@barnhill
Copy link
Owner

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

@barnhill barnhill self-assigned this Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants