AutoSizeMode

AutoSizeMode enumeration

Specifies the different types of automatic sizing modes. Default value is AutoSizeMode.NONE.

public enum AutoSizeMode

Values

NameValueDescription
NONE0Automatic resizing is disabled. Default value.
NEAREST1Barcode resizes to nearest lowest possible size which are specified by BarCodeWidth and BarCodeHeight properties.
INTERPOLATION2Resizes barcode to specified size with little scaling but it can be little damaged in some cases because using interpolation for scaling. Size can be specified by BarcodeGenerator.BarCodeWidth and BarcodeGenerator.BarCodeHeight properties. This sample shows how to create and save a BarCode image in Scale mode. let generator = new BarcodeGenerator( EncodeTypes.DATA_MATRIX); generator.getParameters().getBarcode().setAutoSizeMode(AutoSizeMode.INTERPOLATION); generator.getParameters().getBarcode().getBarCodeWidth().setMillimeters(50); generator.getParameters().getBarcode().getBarCodeHeight().setInches(1.3); generator.save(“test.png”, BarcodeImageFormat.PNG);

Examples

//This sample shows how to create and save a BarCode image:
let generator = new BarcodeGenerator(EncodeTypes.DATA_MATRIX);
generator.setAutoSizeMode(AutoSizeMode.NEAREST);
generator.getBarCodeWidth().setMillimeters(50);
generator.getBarCodeHeight().setInches(1.3f);
generator.save("test.png", BarcodeImageFormat.PNG);

See Also