Aspose.Barcode for Python via Java Generation and Recognition API docs
AutoSizeMode Class Reference

Specifies the different types of automatic sizing modes. More...

Inherits Enum.

Static Public Attributes

int INTERPOLATION = 2
 
int NEAREST = 1
 Barcode resizes to nearest lowest possible size which are specified by BarCodeWidth and BarCodeHeight properties. More...
 
int NONE = 0
 Automatic resizing is disabled. More...
 

Detailed Description

Specifies the different types of automatic sizing modes.

Default value is AutoSizeMode.NONE. This sample shows how to create and save a BarCode image.

generator = BarcodeGenerator(EncodeTypes.DATA_MATRIX)
generator.setAutoSizeMode(AutoSizeMode.NEAREST)
generator.getBarCodeWidth().setMillimeters(50)
generator.getBarCodeHeight().setInches(1.3f)
generator.save("test.png", BarCodeImageFormat.PNG)

Member Data Documentation

◆ INTERPOLATION

int INTERPOLATION = 2
static

◆ NEAREST

int NEAREST = 1
static

Barcode resizes to nearest lowest possible size which are specified by BarCodeWidth and BarCodeHeight properties.

Resizes 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.

generator = Generation.BarcodeGenerator(Generation.EncodeTypes.DATA_MATRIX,"12345")
generator.getParameters().setAutoSizeMode(Generation.AutoSizeMode.NEAREST)
generator.getParameters().getImageWidth().setMillimeters(10)
generator.getParameters().getImageHeight().setInches(1.3)
generator.save(self.image_path_to_save4, Generation.BarCodeImageFormat.PNG)

◆ NONE

int NONE = 0
static

Automatic resizing is disabled.

Default value.