<?php
/*
osCommRes, Services Online 
http://www.oscommres.com 
Copyright (c) 2005 osCommRes 

Freeway eCommerce 
http://www.zac-ware.com/freeway 
Copyright (c) 2007 ZacWare

Released under the GNU General Public License 
*/
	define('IN_CB',true);
	require('barcode/index.php');
	require('barcode/FColor.php');
	require('barcode/BarCode.php');
	require('barcode/FDrawing.php');
	include('barcode/code128.barcode.php');

	function create_bar_image($bar_text,$bar_filename){
		$output=1;
		$thickness=15;
		$resolution=1;
		$font_size=1;
		$a1="A";

		$color_black = new FColor(0,0,0);
		$color_white = new FColor(255,255,255);

		$code_generated = new code128($thickness,$color_black,$color_white,$resolution,$bar_text,$font_size,$a1);

		$drawing = new FDrawing(1024,1024,'',$color_white);
		$drawing->filename=$bar_filename;
		$drawing->init();
		$drawing->add_barcode($code_generated);
		$drawing->draw_all();
		$im = $drawing->get_im();
		$im2 = imagecreate($code_generated->lastX,$code_generated->lastY);
		imagecopyresized($im2, $im, 0, 0, 0, 0, $code_generated->lastX, $code_generated->lastY, $code_generated->lastX, $code_generated->lastY);
		$drawing->set_im($im2);
		$drawing->finish($output);
	}
?>