當前位置: 首頁>>代碼示例>>PHP>>正文


PHP captcha::CreateImage方法代碼示例

本文整理匯總了PHP中captcha::CreateImage方法的典型用法代碼示例。如果您正苦於以下問題:PHP captcha::CreateImage方法的具體用法?PHP captcha::CreateImage怎麽用?PHP captcha::CreateImage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在captcha的用法示例。


在下文中一共展示了captcha::CreateImage方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: CreateImage

<?php

$captcha = new captcha();
$captcha->CreateImage();
class captcha
{
    public $width = 150;
    public $height = 50;
    public $font_path = 'fonts/';
    public $minWordLength = 5;
    public $maxWordLength = 5;
    public $backgroundColor = array(255, 255, 255);
    public $colors = array(array(27, 78, 181), array(22, 163, 35), array(214, 36, 7));
    public $shadowColor = null;
    public $fonts = array('Antykwa' => array('spacing' => -3, 'minSize' => 27, 'maxSize' => 30, 'font' => 'AntykwaBold.ttf'), 'Candice' => array('spacing' => -1.5, 'minSize' => 28, 'maxSize' => 31, 'font' => 'Candice.ttf'), 'DingDong' => array('spacing' => -2, 'minSize' => 24, 'maxSize' => 30, 'font' => 'Ding-DongDaddyO.ttf'), 'Duality' => array('spacing' => -2, 'minSize' => 30, 'maxSize' => 38, 'font' => 'Duality.ttf'), 'Heineken' => array('spacing' => -2, 'minSize' => 24, 'maxSize' => 34, 'font' => 'Heineken.ttf'), 'Jura' => array('spacing' => -2, 'minSize' => 28, 'maxSize' => 32, 'font' => 'Jura.ttf'), 'StayPuft' => array('spacing' => -1.5, 'minSize' => 28, 'maxSize' => 32, 'font' => 'StayPuft.ttf'), 'Times' => array('spacing' => -2, 'minSize' => 28, 'maxSize' => 34, 'font' => 'TimesNewRomanBold.ttf'), 'VeraSans' => array('spacing' => -1, 'minSize' => 20, 'maxSize' => 28, 'font' => 'VeraSansBold.ttf'));
    public $Yperiod = 12;
    public $Yamplitude = 14;
    public $Xperiod = 11;
    public $Xamplitude = 5;
    public $maxRotation = 8;
    public $scale = 2;
    public $blur = false;
    public $imageFormat = 'png';
    public $im;
    public function CreateImage()
    {
        $ini = microtime(true);
        $this->ImageAllocate();
        $text = $this->GetCaptchaText();
        $fontcfg = $this->fonts[array_rand($this->fonts)];
        $this->WriteText($text, $fontcfg);
開發者ID:kapai69,項目名稱:fl-ru-damp,代碼行數:31,代碼來源:captcha.php

示例2: captcha

 /**
  * Cria o captcha caso o número de tentativas de login falhos seja maior ou igual a 5
  */
 public function captcha()
 {
     $captcha = new captcha();
     if ($_SESSION['ntentativaLogin'] >= 5) {
         $captcha->CreateImage();
     } else {
         echo false;
     }
 }
開發者ID:Wellingtoncezar,項目名稱:pfc,代碼行數:12,代碼來源:login.controller.php


注:本文中的captcha::CreateImage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。