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.
The following example demonstrates how to apply the manual sizing mode to the Code39 Barcode.
Code39 manual sizing mode
<Grid Background="White" xmlns:telerikDataViz="using:Telerik.UI.Xaml.Controls.DataVisualization"> <telerikDataViz:RadBarcode Width="250" Height="150" Value="58000106" Foreground="Black" HorizontalAlignment="Center" VerticalAlignment="Center"> <telerikDataViz:RadBarcode.Symbology> <telerikDataViz:Code39 HorizontalTextAlignment="Center" SizingMode="Manual" Module="2" ShowText="True" CodeTextSpacing="10"/> </telerikDataViz:RadBarcode.Symbology> </telerikDataViz:RadBarcode> </Grid>
A Barcode with its applied manual sizing mode