C# 生成条形码
C# 生成条形码
上一篇分享了关于二维码的生成,本篇将分享条形码。
该方法需要引用 BarcodeLib.dll
链接: https://pan.baidu.com/s/1GhEG9-UDa3-2-bSoT62zkA
提取码: h72q
public static Image CreateBarCode(string content) { using (var barcode = new Barcode() { //true显示content,false反之 IncludeLabel = true, //content的位置 Alignment = AlignmentPositions.CENTER, //条形码的宽高 Width = 150, Height = 50, //类型 RotateFlipType = RotateFlipType.RotateNoneFlipNone, //颜色 BackColor = Color.White, ForeColor = Color.Black, }) { return barcode.Encode(TYPE.CODE128B, content); } }
本篇文章为个人收藏学习,为初学者提供帮助,如侵犯他人版权,请联系本人!邮箱:ocean0213@sina.cn