16, Barcode Generation Package Class

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.