BarcodeDrawingOptions Class
Options for drawing a barcode on a DrawingCanvas.
public sealed class BarcodeDrawingOptionsRemarks
The sizes are in the units of the canvas: pixels, unless a transform is applied.
Constructors
| Name | Description |
|---|---|
| BarcodeDrawingOptions() |
BarcodeDrawingOptions()
BarcodeDrawingOptions.cspublic BarcodeDrawingOptions()No documentation is available.
Properties
| Name | Description |
|---|---|
| DarkBrush | Gets or sets the brush of the bars. Default is a black SolidBrush. |
| Font | Gets or sets the font of the human-readable text (Barcode.Text) printed under the bars. Default is null: no text. |
| FontSize | Gets or sets the size of the font, in units per em. Default is 14. |
| LightBrush | Gets or sets the brush of the spaces, of the quiet zone and of the background of the text. Default is a white SolidBrush. |
| ModuleHeight | Gets or sets the height of each module, which is the height of the bars. Default is 80. |
| ModuleWidth | Gets or sets the width of each module. Default is 2. |
| QuietZoneModules | Gets or sets the number of quiet zone modules on the left and right sides of the barcode. Default is 10. |
| SnapToPixels | Gets or sets a value indicating whether the module sizes and the positions are rounded to whole units. Default is true. |
| TextBrush | Gets or sets the brush of the text. Default is null: the text is painted with BarcodeDrawingOptions.DarkBrush. |
| TextSpacing | Gets or sets the space between the bottom of the bars and the top of the text. Default is 2. |
DarkBrush
BarcodeDrawingOptions.csGets or sets the brush of the bars. Default is a black SolidBrush.
public Brush DarkBrush { get; set; }Property value
Remarks
The brush is in the coordinates of the canvas: a gradient spans the canvas, not the barcode.
Gets or sets the font of the human-readable text (Barcode.Text) printed under the bars. Default is null: no text.
public Font? Font { get; set; }FontSize
BarcodeDrawingOptions.csLightBrush
BarcodeDrawingOptions.csGets or sets the brush of the spaces, of the quiet zone and of the background of the text. Default is a white SolidBrush.
public Brush? LightBrush { get; set; }Property value
Remarks
null leaves the pixels under the spaces, the quiet zone and the text unchanged.
ModuleHeight
BarcodeDrawingOptions.csModuleWidth
BarcodeDrawingOptions.csQuietZoneModules
BarcodeDrawingOptions.csSnapToPixels
BarcodeDrawingOptions.csGets or sets a value indicating whether the module sizes and the positions are rounded to whole units. Default is true.
public bool SnapToPixels { get; set; }Property value
Remarks
Rounding gives every bar of one width the same width and sharp edges, which scanners read best. The module sizes round to the nearest whole number, at least 1. Set false to draw at the exact sizes and position.
TextBrush
BarcodeDrawingOptions.csGets or sets the brush of the text. Default is null: the text is painted with BarcodeDrawingOptions.DarkBrush.
public Brush? TextBrush { get; set; }