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.

Setting the Stretch Property

In XAML:

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

In C#:

var Barcode = new XamQRCodeBarcode();
Barcode.Stretch = BarcodeStretch.Fill;