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

Public Attributes

const NONE = '0'
 
const NEAREST = '1'
 
const INTERPOLATION = '2'
 

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->setAutoSizeMode(AutoSizeMode.NEAREST);
$generator->getBarCodeWidth()->setMillimeters(50);
$generator->getBarCodeHeight()->setInches(1.3f);
$generator->save("test.png");

Member Data Documentation

◆ INTERPOLATION

const AutoSizeMode::INTERPOLATION = '2'

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->getParameters()->getBarcode()->setAutoSizeMode(AutoSizeMode::INTERPOLATION);
$generator->getParameters()->getBarcode()->getBarCodeWidth()->setMillimeters(50);
$generator->getParameters()->getBarcode()->getBarCodeHeight()->setInches(1.3);
$generator->save("test.png", "PNG);

◆ NEAREST

const AutoSizeMode::NEAREST = '1'

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

◆ NONE

const AutoSizeMode::NONE = '0'

Automatic resizing is disabled. Default value.