当前位置: 首页>>代码示例>>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;未经允许,请勿转载。