PHP Classes

File: libs/Barcode/test.php

Recommend this page to a friend!
  Classes of william amed   Raptor 2   libs/Barcode/test.php   Download  
File: libs/Barcode/test.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Raptor 2
Framework that takes routes from annotations
Author: By
Last change:
Date: 7 years ago
Size: 526 bytes
 

Contents

Class file image Download
<?php
require_once('class/BCGColor.php');
require_once(
'class/BCGDrawing.php');
require_once(
'class/BCGcode39.barcode.php');
 
$colorfg = new BCGColor(0, 0, 0);
$colorbg = new BCGColor(255, 255, 255);
 
// Barcode Part
$code = new BCGcode39();
$code->setScale(3);

$code->setColor($colorfg, $colorbg);
$code->parse('EHD2345543453');
 
// Drawing Part
$drawing = new BCGDrawing('', $colorbg);
$drawing->setBarcode($code);
$drawing->draw();
 
header('Content-Type: image/png');
 
$drawing->finish(BCGDrawing::IMG_FORMAT_PNG);
?>