Package org.krysalis.barcode4j.output.java2d

Examples of org.krysalis.barcode4j.output.java2d.Java2DCanvasProvider


    if (foregroundColor != null)
    {
      g2d.setColor(foregroundColor);
    }

    final Java2DCanvasProvider canvas = new Java2DCanvasProvider(g2d, 0);

    //now paint the barcode
    generator.generateBarcode(canvas, message);
  }
View Full Code Here


       
            g2d.translate(x - 10 + (width - (int)(m_iWidth * scale)) / 2, y + 10);
            g2d.scale(scale, scale);

            try {
                m_barcode.generateBarcode(new Java2DCanvasProvider(g2d, 0), m_sCode);
            } catch (IllegalArgumentException e) {
                g2d.drawRect(0, 0, m_iWidth, m_iHeight);
                g2d.drawLine(0, 0, m_iWidth, m_iHeight);
                g2d.drawLine(m_iWidth, 0, 0, m_iHeight);
            }
View Full Code Here

       
            g2d.translate(x - 10 + (width - (int)(m_iWidth * scale)) / 2, y + 10);
            g2d.scale(scale, scale);

            try {
                m_barcode.generateBarcode(new Java2DCanvasProvider(g2d, 0), m_sCode);
            } catch (IllegalArgumentException e) {
                g2d.drawRect(0, 0, m_iWidth, m_iHeight);
                g2d.drawLine(0, 0, m_iWidth, m_iHeight);
                g2d.drawLine(m_iWidth, 0, 0, m_iHeight);
            }
View Full Code Here

        g2d.fillRect(0, 0, width, height);
       
        g2d.setColor(Color.BLACK);
       
        try {
            barcode.generateBarcode(new Java2DCanvasProvider(g2d, 0), value);
        } catch (IllegalArgumentException e) {
            g2d.drawRect(0, 0, width - 1, height - 1);
            g2d.drawString(value, 2, height - 3);
        }
       
View Full Code Here

TOP

Related Classes of org.krysalis.barcode4j.output.java2d.Java2DCanvasProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.