com.octo.captcha.component.image.backgroundgenerator
Class FileReaderRandomBackgroundGenerator
java.lang.Object
com.octo.captcha.component.image.backgroundgenerator.AbstractBackgroundGenerator
com.octo.captcha.component.image.backgroundgenerator.FileReaderRandomBackgroundGenerator
- All Implemented Interfaces:
- BackgroundGenerator
public class FileReaderRandomBackgroundGenerator
- extends AbstractBackgroundGenerator
File reader background generator that return a random image (JPEG ONLY) from the ones found in the directory
You can place images in the classpath directory, in this case take care to use a unique directory name (not already contained in a jar file)
TODO : add some gif, bmp,... reader facilities.
Method Summary |
protected java.io.File |
findDirectory(java.lang.String rootPath)
|
java.awt.image.BufferedImage |
getBackground()
Generates a backround image on wich text will be paste. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cachedDirectories
protected static final java.util.Map cachedDirectories
FileReaderRandomBackgroundGenerator
public FileReaderRandomBackgroundGenerator(java.lang.Integer width,
java.lang.Integer height,
java.lang.String rootPath)
findDirectory
protected java.io.File findDirectory(java.lang.String rootPath)
getBackground
public java.awt.image.BufferedImage getBackground()
- Generates a backround image on wich text will be paste. Implementations must take into account the imageHeigt and
imageWidth.
- Returns:
- the background image
Copyright 2003-2009 JCaptcha. All Rights Reserved.