Exemplo n.º 1
0
 /**
  * 输出校验码图片二进制
  * @param int $length 输出几个字符
  * @param int $width 图片宽度
  * @param int $height 图片高度
  *
  */
 public function image($length = 5, $width = 200, $height = 60, $minFontSize = 12, $maxFontSize = 16)
 {
     $fonts = array(_PLUGIN_ . 'Captcha/VeraBd.ttf', _PLUGIN_ . 'Captcha/VeraIt.ttf', _PLUGIN_ . 'Captcha/Vera.ttf');
     $this->_captcha = new PhpCaptcha($fonts, $width, $height);
     $this->_captcha->SetMinFontSize($minFontSize);
     $this->_captcha->SetMaxFontSize($maxFontSize);
     $this->_captcha->UseColour(true);
     $this->_captcha->SetNumChars($length);
     $this->_captcha->Create();
 }