The 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
Moduleproperty and, as a result, the other lines and dots multiply that size. The
Moduleproperty 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.
To apply the desired sizing mode to the Barcode:
Add the sizing mode you need to the barcode, for example, the manual one.
<telerik:RadBarcode WidthRequest="300" HeightRequest="100" HorizontalOptions="Center" VerticalOptions="Center" Value="58000106"> <telerik:RadBarcode.Symbology> <telerik:Code39 HorizontalTextAlignment="Center" SizingMode="Manual" Module="2" ShowText="True" CodeTextSpacing="10"/> </telerik:RadBarcode.Symbology> </telerik:RadBarcode>
Add the following namespace.
The following image shows a barcode with its applied manual sizing mode.