Study Address: http://www.cnblogs.com/ForEvErNoME/archive/2012/04/21/2460944.html
Instance code:
<?php// refer to Class require_once (' class/bcgfontfile.php '), require_once (' class/bcgcolor.php '); require _once (' class/bcgdrawing.php ');// Barcode encoding Format require_once (' class/bcgcode39.barcode.php ');// load font size $font = new bcgfontfile ('./class/font/arial.ttf ', 18);//Color Barcode $color_black = new Bcgcolor (0, 0, 0), $color _white = new bcgcolor (255, 255, 255); $drawException = null;try { $code = new bcgcode39 (); $code->setscale (2); $code->setthickness (); // barcode thickness $code->setforegroundcolor ($color _black); // barcode Color $code->setbackgroundcolor ($color _white); // blank gap color $code->setfont ($font ); // $code->parse (' HELLO '); // barcode required Data content} catch ( exception $exception) { $drawException = $exception;} Draw the Barcode $drawing = new bcgdrawing (', $color _white) According to the above conditions; if ($drawException) { $drawing->drawexception ($drawException);} else { $drawing->setbarcode ($code); $drawing Draw ();} Generate image header (' content-type: image/png ') in PNG format; $drawing->finish (bcgdrawing::img_format_png);? >
16, Barcode Generation Package Class