ImageCaptcha()

edit

Creates a captcha image

Requires Extension: Image Extension for Jakarta EE (Lucee 7+)

ImageCaptcha( text=string, height=numeric, width=numeric, difficulty=string, fonts=any, fontsize=numeric, fontcolor=string );

Returns: any

Argument Description Default
text
string, required
edit

Text in the captcha.

height
numeric, required
edit

Height of the captcha.

width
numeric, required
edit

Width of the captcha.

difficulty
string, optional
edit

Level of complexity of the CAPTCHA text.

Specify one of the following levels of text distortion: low, medium, high

low

fonts
any, optional
edit

One or more valid fonts to use for the CAPTCHA text, as an array or as string list (separate multiple fonts with commas). Lucee supports only the system fonts that the JDK can recognize. For example, TTF fonts in the Windows directory are supported on Windows.

Alias: font

arial

fontsize
numeric, optional
edit

font size of the text in the CAPTCHA image.

Alias: size

24

fontcolor
string, optional
edit

font color of the text in the CAPTCHA image.

Alias: color

black

Examples

edit
	imagewritetobrowser(imagecaptcha( "abcdec", 100, 300, "low"));
	imagewritetobrowser(imagecaptcha( "abcdec", 100, 300, "medium"));
	imagewritetobrowser(imagecaptcha( "abcdec", 100, 300, "high"));

See also