public abstract class AbstractCaptcha extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DIFFICULTY_HIGH |
static int |
DIFFICULTY_LOW |
static int |
DIFFICULTY_MEDIUM |
Constructor and Description |
---|
AbstractCaptcha() |
Modifier and Type | Method and Description |
---|---|
BufferedImage |
generate(String text,
int width,
int height,
String[] fonts,
boolean useAntiAlias,
Color fontColor,
int fontSize,
int difficulty)
generates a Captcha as a Buffered Image file
|
abstract Font |
getFont(String font,
Font defaultValue)
creates a font from given string
|
public static final int DIFFICULTY_LOW
public static final int DIFFICULTY_MEDIUM
public static final int DIFFICULTY_HIGH
public AbstractCaptcha()
public BufferedImage generate(String text, int width, int height, String[] fonts, boolean useAntiAlias, Color fontColor, int fontSize, int difficulty) throws CaptchaException
text
- text for the captchawidth
- width of the resulting imageheight
- height of the resulting imagefonts
- list of font used for the captcha (all font are random used)useAntiAlias
- use anti aliasing or notfontColor
- color of the fontfontSize
- size of the fontdifficulty
- difficulty of the reslting captchaCaptchaException
Copyright © 2015 Lucee