VintaSoft Barcode .NET SDK v11.0
In This Topic
    Get barcode image as Android.Graphics.Path object in Xamarin.Android
    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.

    /// <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();
    }