Properties

$fingerprint

$fingerprint : array

Type

array

$useFingerprint

$useFingerprint : boolean

Type

boolean

$textColor

$textColor : array

Type

array

$backgroundColor

$backgroundColor : array

Type

array

$contents

$contents : resource

Type

resource

$phrase

$phrase : string

Type

string

$distortion

$distortion : boolean

Type

boolean

$maxFrontLines

$maxFrontLines : 

The maximum number of lines to draw in front of the image. null - use default algorithm.

Type

$maxBehindLines

$maxBehindLines : 

The maximum number of lines to draw behind the image. null - use default algorithm.

Type

$maxAngle

$maxAngle : 

The maximum angle of char.

Type

$maxOffset

$maxOffset : 

The maximum offset of char.

Type

$interpolation

$interpolation : boolean

Is the interpolation enabled ?

Type

boolean

$ignoreAllEffects

$ignoreAllEffects : boolean

Ignore all effects.

Type

boolean

$charset

$charset : 

Type

$codelen

$codelen : 

Type

$width

$width : 

Type

$height

$height : 

Type

$font

$font : 

Type

$fontsize

$fontsize : 

Type

Methods

getContents()

getContents() 

The image contents.

setInterpolation()

setInterpolation(  $interpolate = true) : \CaptchaBuilder

Enable/Disables the interpolation.

Parameters

$interpolate

bool True to enable, false to disable

Returns

\CaptchaBuilder

__construct()

__construct() 

setPhrase()

setPhrase(  $phrase) 

Setting the phrase.

Parameters

$phrase

setDistortion()

setDistortion(  $distortion) 

Enables/disable distortion.

Parameters

$distortion

setMaxBehindLines()

setMaxBehindLines(  $maxBehindLines) 

Parameters

$maxBehindLines

setMaxFrontLines()

setMaxFrontLines(  $maxFrontLines) 

Parameters

$maxFrontLines

setMaxAngle()

setMaxAngle(  $maxAngle) 

Parameters

$maxAngle

setMaxOffset()

setMaxOffset(  $maxOffset) 

Parameters

$maxOffset

getPhrase()

getPhrase() 

Gets the captcha phrase.

create()

create(  $phrase = null) 

Instantiation.

Parameters

$phrase

setTextColor()

setTextColor(  $r,   $g,   $b) 

Sets the text color to use.

Parameters

$r
$g
$b

setBackgroundColor()

setBackgroundColor(  $r,   $g,   $b) 

Sets the background color to use.

Parameters

$r
$g
$b

setIgnoreAllEffects()

setIgnoreAllEffects(boolean  $ignoreAllEffects) : \CaptchaBuilder

Sets the ignoreAllEffects value.

Parameters

boolean $ignoreAllEffects

Returns

\CaptchaBuilder

setBackgroundImages()

setBackgroundImages(array  $backgroundImages) 

Sets the list of background images to use (one image is randomly selected).

Parameters

array $backgroundImages

build()

build(  $fingerprint = null) 

Generate the image.

Parameters

$fingerprint

distort()

distort(  $image,   $width,   $height,   $bg) 

Distorts the image.

Parameters

$image
$width
$height
$bg

getGd()

getGd() 

Gets the image GD.

get()

get(  $quality = 90) 

Gets the image contents.

Parameters

$quality

inline()

inline(  $quality = 90) 

Gets the HTML inline base64.

Parameters

$quality

directOutput()

directOutput(  $quality = 90) 

Outputs the image.

Parameters

$quality

output()

output(  $n = null) 

Outputs the image.

Parameters

$n

GetImg()

GetImg(  $n = null) 

对外生成.

Parameters

$n

getFingerprint()

getFingerprint() : array

Returns

array

GetCode()

GetCode() : string

获取验证码

Returns

string

createCode()

createCode(  $n = null) 

生成随机码

Parameters

$n

drawLine()

drawLine(  $image,   $width,   $height,   $tcol = null) 

Draw lines over the image.

Parameters

$image
$width
$height
$tcol

postEffect()

postEffect(  $image) 

Apply some post effects.

Parameters

$image

writePhrase()

writePhrase(  $image,   $phrase,   $font,   $width,   $height) 

Writes the phrase on the image.

Parameters

$image
$phrase
$font
$width
$height

rand()

rand(  $min,   $max) 

Returns a random number or the next number in the fingerprint.

Parameters

$min
$max

interpolate()

interpolate(  $x,   $y,   $nw,   $ne,   $sw,   $se) : integer

Parameters

$x
$y
$nw
$ne
$sw
$se

Returns

integer

getCol()

getCol(  $image,   $x,   $y,   $background) : integer

Parameters

$image
$x
$y
$background

Returns

integer

getRGB()

getRGB(  $col) : array

Parameters

$col

Returns

array