In This Article

LinearBarCodeSymbology Class

Provides the base class for a one-dimensional bar code symbology.

public abstract class LinearBarCodeSymbology : BarCodeSymbology, DUCE.IResource, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IHaveResources, IQueryAmbient
Inheritance:
Object DispatcherObject DependencyObject Visual UIElement FrameworkElement BarCodeSymbology Object
Derived:
CodabarSymbology Code128Symbology Code39Symbology Code93Symbology Ean13Symbology Ean8Symbology Interleaved2of5Symbology PostnetSymbology UpcASymbology UpcESymbology

Remarks

For detailed documentation on this symbology's features and how to use them, please see the Bar Code Symbology-related series of documentation topics.

Constructors

LinearBarCodeSymbology()

protected LinearBarCodeSymbology()

Properties

BarData

Gets or sets the string that specifies the data used to draw the bar code.

protected string BarData { get; set; }

Property Value

String:

The string that specifies the data used to draw the bar code.

BarHeight

Gets or sets the desired height of the bars.

public double BarHeight { get; set; }

Property Value

Double:

The desired height of the bars. 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

Gets or sets the width ratio of wide lines to narrow lines.

public double BarWidthRatio { get; set; }

Property Value

Double:

The width ratio of wide lines to narrow lines. The default value is 2, meaning that wide lines are twice as thick as narrow lines.

DisplayValue

Gets or sets the value that is displayed if ValueDisplayStyle is not None.

public string DisplayValue { get; protected set; }

Property Value

String:

The value that is displayed if ValueDisplayStyle is not None.

Remarks

This property must be set by each symbology implementation.

Instructions

Gets or sets the dictionary of BarData characters and their related instructions.

protected Dictionary<char, LinearBarCodeSymbologyInstruction> Instructions { get; set; }

Property Value

Dictionary<Char, LinearBarCodeSymbologyInstruction>:

The dictionary of BarData characters and their related instructions.

MinBarHeightWidthRatio

Gets or sets 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 minimum ratio that the height of the bar code must be in relation to its width. 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

Gets or sets the Thickness of the quiet zone.

public Thickness QuietZoneThickness { get; set; }

Property Value

Thickness:

The Thickness of the quiet zone. The default value is 10,0,10,0.

Remarks

The quiet zone is the margin whitespace area that appears around the bar code.

ValueDisplayStyle

Gets or sets a LinearBarCodeValueDisplayStyle that indicates how the value should rendered.

public LinearBarCodeValueDisplayStyle ValueDisplayStyle { get; set; }

Property Value

LinearBarCodeValueDisplayStyle:

A LinearBarCodeValueDisplayStyle that indicates how the value should rendered. The default value is Centered.

ValueIntrusionOffset

Gets or sets the distance that the Value text intrudes into the bar code when ValueDisplayStyle is not None.

public double ValueIntrusionOffset { get; set; }

Property Value

Double:

The distance that the Value text intrudes into the bar code when ValueDisplayStyle is not None. The default value is 0.

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

Identifies the BarData dependency property. This field is read-only.

public static readonly DependencyProperty BarDataProperty

BarHeightProperty

Identifies the BarHeight dependency property. This field is read-only.

public static readonly DependencyProperty BarHeightProperty

BarWidthRatioProperty

Identifies the BarWidthRatio dependency property. This field is read-only.

public static readonly DependencyProperty BarWidthRatioProperty

DisplayValueProperty

Identifies the DisplayValue dependency property. This field is read-only.

public static readonly DependencyProperty DisplayValueProperty

InstructionsProperty

Identifies the Instructions dependency property. This field is read-only.

public static readonly DependencyProperty InstructionsProperty

MinBarHeightWidthRatioProperty

Identifies the MinBarHeightWidthRatio dependency property. This field is read-only.

public static readonly DependencyProperty MinBarHeightWidthRatioProperty

QuietZoneThicknessProperty

Identifies the QuietZoneThickness dependency property. This field is read-only.

public static readonly DependencyProperty QuietZoneThicknessProperty

ValueDisplayStyleProperty

Identifies the ValueDisplayStyle dependency property. This field is read-only.

public static readonly DependencyProperty ValueDisplayStyleProperty

ValueIntrusionOffsetProperty

Identifies the ValueIntrusionOffset dependency property. This field is read-only.

public static readonly DependencyProperty ValueIntrusionOffsetProperty

Inherited Members

Extension Methods