Exemplo n.º 1
0
<?php

ob_start();
session_start();
include "./phptextClass.php";
/*create class object*/
$phptextObj = new phptextClass();
/*phptext function to genrate image with text*/
$phptextObj->phpcaptcha('#162453', '#fff', 120, 40, 10, 25);
Exemplo n.º 2
0
        return array('r' => $r, 'g' => $g, 'b' => $b);
    }
    /*function to get center position on image*/
    protected function ImageTTFCenter($image, $text, $font, $size, $angle = 8)
    {
        $xi = imagesx($image);
        $yi = imagesy($image);
        $box = imagettfbbox($size, $angle, $font, $text);
        $xr = abs(max($box[2], $box[4]));
        $yr = abs(max($box[5], $box[7]));
        $x = intval(($xi - $xr) / 2);
        $y = intval(($yi + $yr) / 2);
        return array($x, $y);
    }
}
$phptextObj = new phptextClass();
$phptextObj->phpcaptcha('#31627A', '#FFFFFF', 120, 40, 10, 25, '#66CCFF');
//
//
//class phptextClass
//{
//public function phpcaptcha()
//	{
//$characters=6;
//$letters = '23456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
//
//		$str='';
//		for ($i=0; $i<$characters; $i++) {
//			$str .= substr($letters, mt_rand(0, strlen($letters)-1), 1);
//		}
//   $text=$str;
Exemplo n.º 3
0
<?php

session_start();
include "./phptextClass.php";
$phptextObj = new phptextClass();
$phptextObj->phpcaptcha('#F01D1D', '#fff', 40, 19, 34, 1);
Exemplo n.º 4
0
<?php

session_start();
include "./phptextClass.php";
/*create class object*/
$phptextObj = new phptextClass();
/*phptext function to genrate image with text*/
// $phptextObj->phpcaptcha('#162453','#fff',120,40,10,25);
$phptextObj->phpcaptcha('#eb6f11', '#fff', 120, 40, 10, 25);