Version

Configuring Bars Fill Mode

The BarsFillMode property (for all barcode grid symbologies) defines how the internal grid containing the bars will fill the XamBarcode control’s dimensions. It has the following values:

  • FillSpace – ensures that the internal grid will fill the XamBarcode control. Take into consideration that depending on the dimensions of the control and the bars grid and the DPI of the user, in some cases the bars’ width and height differ from the actual ones in pixels. This might make the barcode unreadable – if the internal grid has 200 columns and the width of the control is 300 px then the columns bars will have integer widths (some will be 1px and some 2px) to fill the control. This mode is recommended for all scenarios where there is no machine reading.

In XAML:

<Frame WidthRequest="100" HeightRequest="400" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand">
    <ig:XamQRCodeBarcode x:Name="Barcode" Data="1212312345612345678912345" BarsFillMode="FillSpace"/>
</Frame>

In C#:

var Barcode = new XamQRCodeBarcode();
Barcode.Data = "1212312345612345678912345";
Barcode.BarsFillMode = BarsFillMode.FillSpace;
Note
Note:

FillSpace is the default value of the BarsFillMode property.

  • EnsureEqualSize – ensures that all internal grid bar cells have the same dimensions. If the internal grid has 200 columns and the width of the control is 300px then the grid will shrink to 200px in width making all cells equal. This mode is recommended for machine reading.

In XAML:

 <Frame WidthRequest="100" HeightRequest="400" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand">
    <ig:XamQRCodeBarcode x:Name="Barcode" Data="1212312345612345678912345" BarsFillMode="EnsureEqualSize"/>
</Frame>

In C#:

var Barcode = new XamQRCodeBarcode();
Barcode.Data = "1212312345612345678912345";
Barcode.BarsFillMode = BarsFillMode.EnsureEqualSize;