📄 simplelistimagebynumonlyengine.java
字号:
/* * 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -