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");
}
Aggregations