What's the relationship between Barcode's resolution and image size?


#1

Hi Support,
I’m using Barcode java API to generate barcode image.
I’m a bit confused about the relationship between barcode’s customized resolution and image size.
Could you please give an explanation about it?

Thanks
Jacky


#2

@yixli

Aspose.BarCode provides the Resolution class that developers can use to customize the resolution of barcode images.
The Resolution class has the following major properties:

  • The setDpiX() method is used to set horizontal resolution in dots per inch (DPI).
  • The setDpiY() method is used to set vertical resolution in dots per inch (DPI).

The setDpiX() and setDpiY() methods of the Resolution class accept simple float values to configure horizontal and vertical resolutions.
DPI is a measure of image resolution that specifies the number of dots that a printer or device (like a monitor) can display per linear inch. The higher the DPI, the higher the resolution.

Whereas Aspose.BarCode for Java automatically adjusts the image size (width and height) according to the generated barcode’s size. The image size can also be controlled by specifying the image height and width using the setImageHeight() and setImageWidth() methods. setAutoSize() should be set to false to customize the image size.


#3

Thanks for providing these detailed information.

How does resolution works when i set both image width , image height and resolution meanwhile ?

Thanks
Jacky


#4

@yixli

Image width and height shall set the display size of your barcode image whereas the resolution settings shall set the DPI measurements, the image display quality settings.

Please find the code sample on this link:
https://forum.aspose.com/t/how-does-barcode-customized-resolution-and-image-size-work-together/183707/3