drawBarcode()

Parameters:

Graphics2D g, no default
double left,   default=0.0

double top,  default=0.0

int resolution, default=0

int pixeladjust  default=0

 

Return Type:  void

This method causes a barcode image to be created using the Graphics properties of g

The left and top parameters specify the position of the image on the canvas in the Java units – these will normally be 0.0 for a canvas that has been added to a form, but will be the absolute position when the barcode is to be draw on a printer.

The resolution parameter specifies the resolution (in dpi) of the target image. A value of 0 will cause the standard Java resolution (72 dpi) to be used when the graphics object is a screen, or a printer’s resolution to be used when printing. For many screen based applications it is desirable to use the actual screen resolution – typically 96 dpi.

The pixeladjust parameter may be set to 1 to force the barcode image to have its bar thicknesses to be adjusted to an integer number of pixels. This is essential for images being created for use in a browser (normally 96 dpi), but is not normally required for printing. The result is that the actual image of the barcode is wider or narrower than that to be expected from the dWidth or Xunit properties – but the bars have the sizes suitable for scanning. If the parameter is 0 then no bar adjustment is carried out.

Note that the barcode symbol is created when this method is called, so the ImageHeight and ImageWidth properties are available once this method has been called.

 

More:

drawBarcode2()