imageCaptcha

Provides information about the time when the current application scope was created.

imageCaptcha() → returns any

This function requires Lucee 5 and up.  Not supported on Adobe ColdFusion, etc.

Argument Reference

text string
Required

Text in the image captcha.

height numeric
Required

Height of the image in pixels.

width numeric
Required

Width of the image in pixels.

difficulty string
Default: low

Complexity of the image.
Values:
  • low
  • medium
  • high

fonts any
Default: arial

One or more fonts for the CAPTCHA text, as an array or as string list (separated by commas). Lucee supports the system fonts recognized by JDK only.

fontsize numeric
Default: 24

Font size for text of the image.

fontcolor string
Default: black

Font color for text of the image.

Examples
Sample code invoking the imageCaptcha function

A 300px by 100px image captcha at medium difficulty.


imagewritetobrowser(imagecaptcha( 'abcxyz', 100, 300, 'medium'));

Expected Result: An 300px by 100px image captcha with the letters 'abcxyz'

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub