Search in sources :

Example 1 with Resolution

use of com.aspose.barcode.Resolution in project Aspose.BarCode-for-Java by aspose-barcode.

the class BarcodeImageResolution method main.

public static void main(String[] args) {
    // The path to the resource directory.
    String dataDir = Utils.getDataDir(BarcodeImageResolution.class) + "BarcodeImage/UtilityFeatures/";
    // Instantiate barcode object
    BarCodeBuilder bb = new BarCodeBuilder();
    // Set the Code text for the barcode
    bb.setCodeText("1234567");
    // Set the symbology type to code128
    bb.setEncodeType(com.aspose.barcode.EncodeTypes.CODE_128);
    // Create an instance of resolution and apply on the barcode image with
    // customized resolution settings
    bb.setResolution(new Resolution(200f, 400f, ResolutionMode.Customized));
    // Save the image
    bb.save(dataDir + "barcode-image-resolution.jpg");
}
Also used : BarCodeBuilder(com.aspose.barcode.BarCodeBuilder) Resolution(com.aspose.barcode.Resolution)

Aggregations

BarCodeBuilder (com.aspose.barcode.BarCodeBuilder)1 Resolution (com.aspose.barcode.Resolution)1