Open Yuanliang-xxxxx opened 8 months ago
public void generateQcode(string Code,int Width, int Height, int type = 0) { try { string severPath = getfilepath(); EncodingOptions encodingOptions = null; BarcodeWriter barcodeWriter = null; encodingOptions = new EncodingOptions { Width = Width, Height = Height }; barcodeWriter = new BarcodeWriter(); if (type == 1) { barcodeWriter.Format = BarcodeFormat.QR_CODE; } else { barcodeWriter.Format = BarcodeFormat.CODE_128; }
barcodeWriter.Options = encodingOptions; string text = Code + ".jpg"; Bitmap bitmap = barcodeWriter.Write(Code); if (!DirFileHelper.IsExistDirectory(severPath)) { DirFileHelper.CreateDirectory(severPath); } string filename = severPath + text; bitmap.Save(filename); bitmap.Dispose(); } catch (Exception ex) { throw ex; } }
有咩有大佬
public void generateQcode(string Code,int Width, int Height, int type = 0) { try { string severPath = getfilepath(); EncodingOptions encodingOptions = null; BarcodeWriter barcodeWriter = null; encodingOptions = new EncodingOptions { Width = Width, Height = Height }; barcodeWriter = new BarcodeWriter(); if (type == 1) { barcodeWriter.Format = BarcodeFormat.QR_CODE; } else { barcodeWriter.Format = BarcodeFormat.CODE_128; }