VintaSoft Barcode .NET SDK 16.0: Documentation for .NET developer
Vintasoft.Barcode Namespace / ImageSharpExtensions Class / GetBarcodeAsImage Methods / GetBarcodeAsImage(BarcodeWriter,Double,Double,UnitOfMeasure) Method
Syntax Remarks Requirements SeeAlso
In This Topic
GetBarcodeAsImage(BarcodeWriter,Double,Double,UnitOfMeasure) Method (ImageSharpExtensions)
In This Topic
Returns barcode as a raster image with specified physical size.
Syntax
'Declaration

<ExtensionAttribute()>
Public Overloads Shared Function GetBarcodeAsImage( _
ByVal barcodeWriter
Barcode writer.
As BarcodeWriter, _
ByVal width
The image width, in units.
As Double, _
ByVal height
The image height, in units.
As Double, _
ByVal unitOfMeasure
The unit of measure.
As UnitOfMeasure _
) As SixLabors.ImageSharp.Image
[Extension()]
public static SixLabors.ImageSharp.Image GetBarcodeAsImage(
BarcodeWriter barcodeWriter,
double width,
double height,
UnitOfMeasure unitOfMeasure
)

Parameters

barcodeWriter
Barcode writer.
width
The image width, in units.
height
The image height, in units.
unitOfMeasure
The unit of measure.

Return Value

A barcode as SixLabors.ImageSharp.Image.
Remarks

Important: This method generates barcode image without the barcode text, i.e. method ignores the ValueVisible property.
Use GetBarcodeAsImage(BarcodeWriter) method if you want to get barcode image with barcode text.

The image resolution can be specified using the Resolution property.
The image padding can be specified using the Padding property.
Do not generate barcodes, which contain bars with width less than 2 pixels, because such barcodes are difficult to recognize.

Requirements

Target Platforms: .NET 10; .NET 9; .NET 8; .NET 7; .NET 6

See Also