楼主 你好,
如果需要修改Barcode的线条粗细,可以通过修改下面的属性来实现,默认情况下:
private void btnGenerate_Click(object sender, EventArgs e)
{
string barcode = this.txtBarcodeInput.Text;
var writer = new BarcodeWriter() { Format = BarcodeFormat.CODE_128 };
var bitmap = writer.Write(barcode);
this.picBarcode.Image = bitmap;
}
效果:

修改后:
private void btnGenerate_Click(object sender, EventArgs e)
{
string barcode = this.txtBarcodeInput.Text;
EncodingOptions options = new EncodingOptions();
options.Height = 100;
options.Width = 280;
var writer = new BarcodeWriter() { Format = BarcodeFormat.CODE_128,Options = options };
var bitmap = writer.Write(barcode);
this.picBarcode.Image = bitmap;
}
效果:

记得引入: ZXing.Common 名称空间.
希望我的答案能够帮到你。
谢谢!
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.