You are here

function BARCODE::error in Barcode 6

File

./barcode.inc.php, line 118

Class

BARCODE

Code

function error($asimg = false) {
  if (empty($this->_error)) {
    return "";
  }
  if (!$asimg) {
    return $this->_error;
  }
  @header("Content-type: image/png");
  $im = @imagecreate(250, 100);
  $color = @imagecolorallocate($im, 255, 255, 255);
  $color = @imagecolorallocate($im, 0, 0, 0);
  @imagettftext($im, 10, 0, 5, 50, $color, $this->_font, wordwrap($this->_error, 40, "\n"));
  @imagepng($im);
  @imagedestroy($im);
}