nl.captcha.backgrounds
Class GradiatedBackgroundProducer

java.lang.Object
  extended by nl.captcha.backgrounds.GradiatedBackgroundProducer
All Implemented Interfaces:
BackgroundProducer

public class GradiatedBackgroundProducer
extends java.lang.Object
implements BackgroundProducer

Creates a gradiated background with the given from and to Color values. If none are specified they default to light gray and white respectively.

Author:
James Childers

Constructor Summary
GradiatedBackgroundProducer()
           
GradiatedBackgroundProducer(java.awt.Color from, java.awt.Color to)
           
 
Method Summary
 java.awt.image.BufferedImage addBackground(java.awt.image.BufferedImage image)
          Add the background to the given image.
 java.awt.image.BufferedImage getBackground(int width, int height)
           
 void setFromColor(java.awt.Color fromColor)
           
 void setToColor(java.awt.Color toColor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GradiatedBackgroundProducer

public GradiatedBackgroundProducer()

GradiatedBackgroundProducer

public GradiatedBackgroundProducer(java.awt.Color from,
                                   java.awt.Color to)
Method Detail

getBackground

public java.awt.image.BufferedImage getBackground(int width,
                                                  int height)
Specified by:
getBackground in interface BackgroundProducer

addBackground

public java.awt.image.BufferedImage addBackground(java.awt.image.BufferedImage image)
Description copied from interface: BackgroundProducer
Add the background to the given image.

Specified by:
addBackground in interface BackgroundProducer
Parameters:
image - The image onto which the background will be rendered.
Returns:
The image with the background rendered.

setFromColor

public void setFromColor(java.awt.Color fromColor)

setToColor

public void setToColor(java.awt.Color toColor)


Copyright © 2010-2011 James Childers. All Rights Reserved.