simplelistimagebynumonlyengine.java
来自「一个留言板 系统平台: JSP+SQLServer 支持开通无限个数的留言」· Java 代码 · 共 47 行
JAVA
47 行
/* * SimpleListImageByNumonlyEngine.java * * Created on 2006年7月25日, 下午6:06 * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */package tot.image;import com.octo.captcha.component.image.backgroundgenerator.BackgroundGenerator;import com.octo.captcha.component.image.backgroundgenerator.FunkyBackgroundGenerator;import com.octo.captcha.component.image.fontgenerator.FontGenerator;import com.octo.captcha.component.image.fontgenerator.RandomFontGenerator;import com.octo.captcha.component.image.textpaster.RandomTextPaster;import com.octo.captcha.component.image.textpaster.TextPaster;import java.awt.*;/** * * @author Administrator */public class SimpleListImageByNumonlyEngine extends com.octo.captcha.engine.image.ListImageCaptchaEngine { protected void buildInitialFactories() { com.octo.captcha.component.word.wordgenerator.WordGenerator wordGenerator = new com.octo.captcha.component.word.wordgenerator.RandomWordGenerator( "ABCDEFGHIJKLMNPQRSTUVWXYZ123456789"); TextPaster textPaster = new RandomTextPaster(new Integer(2), new Integer(3), Color.white); //BackgroundGenerator backgroundGenerator = new GradientBackgroundGenerator( new Integer(100), new Integer(45),Color.RED, Color.GREEN); BackgroundGenerator backgroundGenerator =new FunkyBackgroundGenerator(new Integer(100), new Integer(45)); Font[] fonts=new Font[2]; Font boldFont = new Font("Times New Roman",Font.PLAIN,18); fonts[0]=boldFont; FontGenerator fontGenerator = new RandomFontGenerator( new Integer(25), new Integer(26)); com.octo.captcha.component.image.wordtoimage.WordToImage wordToImage = new com.octo.captcha.component.image.wordtoimage.ComposedWordToImage( fontGenerator, backgroundGenerator, textPaster); this.addFactory( new com.octo.captcha.image.gimpy.GimpyFactory(wordGenerator, wordToImage)); } }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?