The WidthToHeightRatio property (for all barcode grid symbologies , excluding the MaxiCode ) defines the width to height ratio of a barcode row. For the linear symbologies, it defines the ratio of the bars height depending on the XDimension property value, i.e. if barcode. WidthToHeightRatio = 30, the bar height is 30*barcode.XDimension. The property value is used to define the symbol bar height when Stretch.None is used and no Height is specified. The nominal value for every barcode is set as its default value.
Note that for the GS1 DataBar family controls, the WidthToHeight property defines the height of the whole symbol, not only for one row. This is necessary because for some code types (Stacked, StackedOmnidirectional, ExpandedStacked) the Height is different for every row of the symbol.
Here is a comparison between two barcodes:
In XAML:
<ig:XamCode128Barcode x:Name="barcode1" Data="CODE Data" Stretch="None" WidthToHeightRatio="25" /> <ig:XamCode128Barcode x:Name="barcode2" Data="CODE Data" Stretch="None" WidthToHeightRatio="35" />
In Visual Basic:
Dim barcode1 As New XamCode128Barcode With _
{
.Stretch = 320, _
.Data = "Code Data", _
.WidthToHeightRatio = 25 _
}
Dim barcode2 As New XamCode128Barcode With _
{
.Stretch = 320, _
.Data = "Code Data", _
.WidthToHeightRatio = 35 _
}
In C#:
var barcode1 = new XamCode128Barcode
{
Width = 320,
Data = "Code Data",
WidthToHeightRatio = 25
};
var barcode2 = new XamCode128Barcode
{
Width = 320,
Data = "Code Data",
WidthToHeightRatio = 35
};