Version

Configuring Stretch

Members of the Stretch property:

  • Fill - The content is resized to fill the destination dimensions. Because the content’s height and width are scaled independently, the original aspect ratio of the image is not preserved which is why we do not recommend using this value when the barcode is used for reading (for reading use None or Uniform). The value is good when using the control with animation.

  • None - The content preserves its nominal dimension.

  • Uniform - The content is resized to fit in the destination dimensions while its native aspect ratio is preserved. This is the default value.

  • UniformToFill - The content is resized to completely fill the destination dimensions while it preserves its native aspect ratio. If the aspect ratio of the destination rectangle differs from the source, the source content is clipped.

The following illustration shows the different Stretch settings.

xamBarcode Stretch 01.png

Setting the Stretch Property

In XAML:

<ig:XamCode128Barcode x:Name="Barcode" Stretch="Fill" />

In Visual Basic:

Dim Barcode As New XamCode128Barcode()
Barcode.Stretch = Stretch.Fill

In C#:

var Barcode = new XamCode128Barcode();
Barcode.Stretch = Stretch.Fill;