LinearBarCodeSymbology Class
Provides the base class for a one-dimensional bar code symbology.
public abstract class LinearBarCodeSymbology : BarCodeSymbology
- Inheritance:
- object Visual UIElement FrameworkElement BarCodeSymbology object
- Derived:
- CodabarSymbology Code128Symbology Code39Symbology Code93Symbology Ean13Symbology Ean8Symbology Interleaved2of5Symbology PostnetSymbology UpcASymbology UpcESymbology
Constructors
LinearBarCodeSymbology()
Initializes an instance of the class.
protected LinearBarCodeSymbology()
Properties
BarData
The string that specifies the data used to draw the bar code.
BarHeight
The desired height of the bars.
public double BarHeight { get; set; }
Property Value
- double:
The default value is
35.
Remarks
When calculating the desired height of the bar code, the BarHeight property will be used unless its height is less than the percentage of the desired width specified by MinBarHeightWidthRatio. In that case the MinBarHeightWidthRatio percentage of the desired width is used for height. This ensures that the bar code is always sized to be read properly.
BarWidthRatio
The width ratio of wide lines to narrow lines.
public double BarWidthRatio { get; set; }
Property Value
- double:
The default value is
2, meaning that wide lines are twice as thick as narrow lines.
DisplayValue
The value that is displayed if ValueDisplayStyle is not None.
public string? DisplayValue { get; protected set; }
Property Value
Remarks
This property must be set by each symbology implementation.
Instructions
The dictionary of BarData characters and their related instructions.
protected Dictionary<char, LinearBarCodeSymbologyInstruction>? Instructions { get; set; }
Property Value
MinBarHeightWidthRatio
The minimum ratio that the height of the bar code must be in relation to its width.
public double MinBarHeightWidthRatio { get; set; }
Property Value
- double:
The default value is
0.15(15%).
Remarks
Many symbologies indicate that the bar code's height must be at least x% of its width.
For instance, Code 39 specifies that the height must be at least 15% of the width.
When calculating the desired height of the bar code, the BarHeight property will be used unless its height is less than the percentage of the desired width specified by MinBarHeightWidthRatio. In that case the MinBarHeightWidthRatio percentage of the desired width is used for height. This ensures that the bar code is always sized to be read properly.
QuietZoneThickness
The Thickness of the quiet zone.
public Thickness QuietZoneThickness { get; set; }
Property Value
- Thickness:
The default value is
10,0,10,0.
Remarks
The quiet zone is the margin whitespace area that appears around the bar code.
ValueDisplayStyle
A LinearBarCodeValueDisplayStyle that indicates how the value should rendered.
public LinearBarCodeValueDisplayStyle ValueDisplayStyle { get; set; }
Property Value
- LinearBarCodeValueDisplayStyle:
The default value is Centered.
ValueIntrusionOffset
The distance that the Value text intrudes into the bar code when ValueDisplayStyle is not None.
Methods
MeasureOverride(Size)
When overridden in a derived class, measures the size in layout required for child elements and determines a size for the FrameworkElement-derived class.
protected override Size MeasureOverride(Size availableSize)
| Parameter | Type | Description |
|---|---|---|
| availableSize | Size | The available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available. |
Returns
- Size:
The size that this element determines it needs during layout, based on its calculations of child element sizes.
Render(DrawingContext, Point, Size)
Renders the symbology to the specified DrawingContext.
public override void Render(DrawingContext drawingContext, Point location, Size size)
| Parameter | Type | Description |
|---|---|---|
| drawingContext | DrawingContext | The DrawingContext upon which to render the symbology. |
| location | Point | The location at which to draw the bar code. |
| size | Size | The size of the bar code to draw. |
Fields
BarDataProperty
Defines the BarData property.
public static readonly DependencyProperty BarDataProperty
BarHeightProperty
Defines the BarHeight property.
public static readonly DependencyProperty BarHeightProperty
BarWidthRatioProperty
Defines the BarWidthRatio property.
public static readonly DependencyProperty BarWidthRatioProperty
DisplayValueProperty
Defines the DisplayValue property.
public static readonly DependencyProperty DisplayValueProperty
InstructionsProperty
Defines the Instructions property.
public static readonly DependencyProperty InstructionsProperty
MinBarHeightWidthRatioProperty
Defines the MinBarHeightWidthRatio property.
public static readonly DependencyProperty MinBarHeightWidthRatioProperty
QuietZoneThicknessProperty
Defines the QuietZoneThickness property.
public static readonly DependencyProperty QuietZoneThicknessProperty
ValueDisplayStyleProperty
Defines the ValueDisplayStyle property.
public static readonly DependencyProperty ValueDisplayStyleProperty
ValueIntrusionOffsetProperty
Defines the ValueIntrusionOffset property.
public static readonly DependencyProperty ValueIntrusionOffsetProperty
Inherited Members
- BarCodeSymbology.BackgroundProperty
- BarCodeSymbology.ForegroundProperty
- BarCodeSymbology.ValueProperty
- BarCodeSymbology.MeasureDesiredSize(Size)
- BarCodeSymbology.OnRender(DrawingContext)
- BarCodeSymbology.OnValueChanged(string, string)
- BarCodeSymbology.ToBitmap(double, double)
- BarCodeSymbology.ValidateValue(string)
- BarCodeSymbology.Background
- BarCodeSymbology.DisplayName
- BarCodeSymbology.Foreground
- BarCodeSymbology.Value