VintaSoft Barcode .NET SDK 15.0: Руководство для .NET разработчика
В этом разделе
    Генерация векторного штрих-кода в виде объекта SixLabors.ImageSharp.Drawing.IPath
    В этом разделе
    Пример: Вот пример, который показывает, как создать векторный штрих-код в виде объекта SixLabors.ImageSharp.Drawing.IPath.

    /// <summary>
    /// Returns a barcode in vector form as SixLabors.ImageSharp.Drawing.IPath object.
    /// </summary>
    /// <param name="barcodeType">Barcode type.</param>
    /// <param name="barcodeValue">Barcode value.</param>
    /// <returns>A barcode in vector form as SixLabors.ImageSharp.Drawing.IPath object.</returns>
    public static SixLabors.ImageSharp.Drawing.IPath GetBarcodeAsGraphicsPath(Vintasoft.Barcode.BarcodeType barcodeType, string barcodeValue)
    {
        // create the barcode writer
        using (Vintasoft.Barcode.BarcodeWriter barcodeWriter = new Vintasoft.Barcode.BarcodeWriter())
        {
            // set barcode writer settings
            barcodeWriter.Settings.Barcode = barcodeType;
            barcodeWriter.Settings.Value = barcodeValue;
    
            // return barcode as GraphicsPath
            return Vintasoft.Barcode.ImageSharpExtensions.GetBarcodeAsIPath(barcodeWriter);
        }
    }
    
    ''' <summary>
    ''' Returns a barcode in vector form as SixLabors.ImageSharp.Drawing.IPath object.
    ''' </summary>
    ''' <param name="barcodeType">Barcode type.</param>
    ''' <param name="barcodeValue">Barcode value.</param>
    ''' <returns>A barcode in vector form as SixLabors.ImageSharp.Drawing.IPath object.</returns>
    Public Shared Function GetBarcodeAsGraphicsPath(barcodeType As Vintasoft.Barcode.BarcodeType, barcodeValue As String) As SixLabors.ImageSharp.Drawing.IPath
        ' create the barcode writer
        Using barcodeWriter As New Vintasoft.Barcode.BarcodeWriter()
            ' set barcode writer settings
            barcodeWriter.Settings.Barcode = barcodeType
            barcodeWriter.Settings.Value = barcodeValue
    
            ' return barcode as GraphicsPath
            Return Vintasoft.Barcode.ImageSharpExtensions.GetBarcodeAsIPath(barcodeWriter)
        End Using
    End Function