You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.1 KiB

1 month ago
  1. 
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.IO;
  7. namespace ReportLibrary
  8. {
  9. public class BarCodeHelper
  10. {
  11. public static byte[] BuildBarCode(string barCode)
  12. {
  13. //ZXing.Common.EncodingOptions options = new ZXing.Common.EncodingOptions()
  14. //{
  15. // Height = 100,//设置宽高
  16. // Width = 200,
  17. //};
  18. ////生成条形码的图片并保存
  19. //ZXing.BarcodeWriter wr = new ZXing.BarcodeWriter()
  20. //{
  21. // Options = options,//进行指定规格
  22. // Format = ZXing.BarcodeFormat.CODE_128,//条形码的规格
  23. //};
  24. //System.Drawing.Bitmap img = wr.Write(barCode);//生成图片
  25. //MemoryStream ms = new MemoryStream();
  26. //img.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
  27. //byte[] BPicture = new byte[ms.Length];
  28. //BPicture = ms.GetBuffer();
  29. //img.Dispose();
  30. //return BPicture;
  31. return new byte[1];
  32. }
  33. }
  34. }