In This Topic
Example: Here is an example that shows how to get a barcode in vector form as Android.Graphics.Path object in Xamarin.Android.
// The project, which uses this code, must have references to the following assemblies:
// - Vintasoft.XamarinBarcode.Android
/// <summary>
/// Returns a barcode in vector form as Android.Graphics.Path object.
/// </summary>
/// <param name="barcodeType">Barcode type.</param>
/// <param name="barcodeValue">Barcode value.</param>
/// <returns>A barcode in vector form as Android.Graphics.Path object.</returns>
public Android.Graphics.Path GetBarcodeAsPathGeometry(Vintasoft.XamarinBarcode.BarcodeType barcodeType, string barcodeValue)
{
// create the barcode writer
Vintasoft.XamarinBarcode.BarcodeWriter barcodeWriter = new Vintasoft.XamarinBarcode.BarcodeWriter();
// set the barcode writer settings
barcodeWriter.Settings.Barcode = barcodeType;
barcodeWriter.Settings.Value = barcodeValue;
// return barcode as Android.Graphics.Path object
return barcodeWriter.GetBarcodeAsPath();
}