Sizing Modes

Barcode provides three sizing modes that enable you to fine-tune the rendering of your codes.

  • Manual—You can define the size of the smallest line or dot of the barcode through the Module property and, as a result, the other lines and dots multiply that size. The Module property is measured in device pixels.
  • Snap—In the snap sizing mode the code is stretched to the available size, but each line or dot is drawn with an exact number of pixels. As a result, the lines and dots seem sharp.
  • Stretch—In the stretch sizing mode the code is stretched so as to fit exactly the available size. Each line or dot size is calculated so they snap to the device pixels. In order for the lines to stay sharp and stretch the barcode to the available size, some of them are slightly thicker than others.

  1. Apply the desired sizing mode to the barcode, for example, the manual one.

    <telerikBarcode:RadBarcode WidthRequest="300" HeightRequest="100"
          HorizontalOptions="Center" VerticalOptions="Center"
          Value="58000106">
      <telerikBarcode:RadBarcode.Symbology>
          <telerikBarcode:Code39 HorizontalTextAlignment="Center"
                            SizingMode="Manual"
                            Module="2"
                            ShowText="True"  
                            CodeTextSpacing="10"/>
      </telerikBarcode:RadBarcode.Symbology>
    </telerikBarcode:RadBarcode>
    
  2. Add the following namespace.

    xmlns:telerikBarcode="clr-namespace:Telerik.XamarinForms.Barcode;assembly=Telerik.Maui.Controls.Compatibility"
    

    The following image shows a barcode with its applied manual sizing mode.

Barcode SizingMode

See Also

In this article
Not finding the help you need?