railo.runtime.img
Class MarpleCaptcha

java.lang.Object
  extended by railo.commons.img.AbstractCaptcha
      extended by railo.runtime.img.MarpleCaptcha

public class MarpleCaptcha
extends AbstractCaptcha


Field Summary
static int DIFFICULTY_HIGH
           
static int DIFFICULTY_LOW
           
static int DIFFICULTY_MEDIUM
           
 
Constructor Summary
MarpleCaptcha()
           
 
Method Summary
 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
 Font getFont(String font, Font defaultValue)
          creates a font from given string
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

MarpleCaptcha

public MarpleCaptcha()
Method Detail

generate

public BufferedImage generate(String text,
                              int width,
                              int height,
                              String[] fonts,
                              boolean useAntiAlias,
                              Color fontColor,
                              int fontSize,
                              int difficulty)
                       throws CaptchaException
Description copied from class: AbstractCaptcha
generates a Captcha as a Buffered Image file

Overrides:
generate in class AbstractCaptcha
Parameters:
text - text for the captcha
width - width of the resulting image
height - height of the resulting image
fonts - list of font used for the captcha (all font are random used)
useAntiAlias - use anti aliasing or not
fontColor - color of the font
fontSize - size of the font
difficulty - difficulty of the reslting captcha
Returns:
captcha image
Throws:
CaptchaException

getFont

public Font getFont(String font,
                    Font defaultValue)
Description copied from class: AbstractCaptcha
creates a font from given string

Specified by:
getFont in class AbstractCaptcha
Returns:


Copyright © 2012 Railo