Barcode Customization in Windows Forms Barcode
12 Apr 2018 / 1 minute to read
The color of the barcode can be customized by modifying the DarkBarBrush and LightBarBrush properties of the barcode control.
this.sfBarcode1.DarkBarColor = System.Drawing.Color.FromArgb(255, 0, 0);
this.sfBarcode1.LightBarColor = System.Drawing.Color.FromArgb(255, 0, 0);
Me.SfBarcode1.DarkBarColor = System.Drawing.Color.FromArgb(255, 0, 0)
Me.SfBarcode1.LightBarColor = System.Drawing.Color.FromArgb(255, 0, 0)
The DarkBarBrush represents the color of the dark bar (Black color usually) and the LightBarBrush represents the color of the gap between two adjacent black bars (White color usually).
Barcode color combinations- Red
Barcode color combinations- Blue
NOTE
The DarkBarBrush and LightBarBrush customizations are applicable only for one dimensional barcodes. In order for a barcode symbol to be recognized by a scanner, there must be an adequate contrast between the dark bars and the light spaces and not all the barcode scanners have support for colored barcodes.
Was this page helpful?
Yes
No
Thank you for your feedback!
Thank you for your feedback and comments. We will rectify this as soon as possible!
An unknown error has occurred. Please try again.
Help us improve this page