railo.commons.img
Class AbstractCaptcha
java.lang.Object
railo.commons.img.AbstractCaptcha
- Direct Known Subclasses:
- Captcha, MarpleCaptcha
public abstract class AbstractCaptcha
- extends Object
Abstract template class for captcha generation
DIFFICULTY_LOW
public static final int DIFFICULTY_LOW
- See Also:
- Constant Field Values
DIFFICULTY_MEDIUM
public static final int DIFFICULTY_MEDIUM
- See Also:
- Constant Field Values
DIFFICULTY_HIGH
public static final int DIFFICULTY_HIGH
- See Also:
- Constant Field Values
AbstractCaptcha
public AbstractCaptcha()
generate
public BufferedImage generate(String text,
int width,
int height,
String[] fonts,
boolean useAntiAlias,
Color fontColor,
int fontSize,
int difficulty)
throws CaptchaException
- generates a Captcha as a Buffered Image file
- Parameters:
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 captcha
- Returns:
- captcha image
- Throws:
CaptchaException
getFont
public abstract Font getFont(String font,
Font defaultValue)
- creates a font from given string
- Parameters:
font
- defaultValue
-
- Returns:
Copyright © 2012 Railo