/*
 * BcImage.java
 *
 * Created on 20. April 2004, 13:21
 */

package it.businesslogic.ireport.barcode;

/**
 *
 * @author  Heiko
 */

import java.awt.image.*;

public class BcImage {	
	private static it.businesslogic.ireport.barcode.Bc bc = new it.businesslogic.ireport.barcode.Bc();
	
	public static it.businesslogic.ireport.barcode.Bc getBarcode() {
		return bc;
	}
	
	public static BufferedImage getBarcodeImage(int type, String text, double angle, boolean checkSum) {	
		bc.setType(type);
		bc.setText(text);
		bc.setAngle(angle);
		bc.setCheckSum(checkSum);
		BufferedImage img = new BufferedImage(bc.getMinimumSize().width , bc.getMinimumSize().height, BufferedImage.TYPE_INT_RGB);
		bc.paint(img.getGraphics());
		return img;
	}	
}
