function AA(){
// Including all required classes
require_once(\'class/BCGFontFile.php\');
require_once(\'class/BCGColor.php\');
require_once(\'class/BCGDrawing.php\');
// Including the barcode technology
require_once(\'class/BCGcode39.barcode.php\');
// Loading Font
$font = new BCGFontFile(\'./class/font/Arial.ttf\', 18);
// The arguments are R, G, B for color.
$color_black = new BCGColor(0, 0, 0);
$color_white = new BCGColor(255, 255, 255);
$drawException = null;
try {
$code = new BCGcode39();
$code->setScale(2); // Resolution
$code->setThickness(30); // Thickness
$code->setForegroundColor($color_black); // Color of bars
$code->setBackgroundColor($color_white); // Color of spaces
$code->setFont($font); // Font (or 0)
$code->parse(\'jebal\'); // Text
} catch(Exception $exception) {
$drawException = $exception;
}
$drawing = new BCGDrawing(\'\', $color_white);
if($drawException) {
$drawing->drawException($drawException);
} else {
$drawing->setBarcode($code);
$drawing->draw();
}
$drawing->finish(BCGDrawing::IMG_FORMAT_PNG);
}
함수 A는 바코드이미지하나를 생성하는 함수거든요.
함수A를 한번만 실행하면 문제없이 위의 이미지처럼 잘나오지만...
두번이상 실행을 하게 되면(한번에 두개이상의 바코드사진을 보기위해) 이상하게 아무것도 나오지가 않네요 ㅜㅜ
왜그런가요 ㅜㅜ제생각엔 이미지를 생성하는거라...마지막 finish에서 문제가생기는거같은데..
어떻게 해결해야 하나요 ㅜㅜ
드릴수있는게설레임밖엔없네요
저 파일 자체가 img로 렌더링 되는 거니까 따로 표기하려면 <img src=\"test.php?text=hello_1\" alt=\"barcode\" /> <img src=\"test.php?text=hello_2\" alt=\"barcode\" /> 이렇게 하면될텐데 저 자체에서 2개 이상 만들어서 렌더링해야함?? 그럴려면 클래스를 디벼보는 수밖에 없지 않음??