?? backgroundcontroller.groovy
字號:
import java.awt.Colorimport nl.captcha.Captchaimport nl.captcha.backgrounds.*import nl.captcha.servlet.CaptchaServletUtil/** * Exercise the various background renderers.**/class BackgroundController { def final WIDTH = 200 def final HEIGHT = 50 def simple = { def captcha = new Captcha.Builder(WIDTH, HEIGHT) .addText() .addBackground() .build() CaptchaServletUtil.writeImage(response, captcha.image) } def squiggles = { def captcha = new Captcha.Builder(WIDTH, HEIGHT) .addText() .addBackground(new SquigglesBackgroundProducer()) .build() CaptchaServletUtil.writeImage(response, captcha.image) } def flatcolor = { def captcha = new Captcha.Builder(WIDTH, HEIGHT) .addText() .addBackground(new FlatColorBackgroundProducer()) .build() CaptchaServletUtil.writeImage(response, captcha.image) } def blue = { def captcha = new Captcha.Builder(WIDTH, HEIGHT) .addText() .addBackground(new FlatColorBackgroundProducer(Color.BLUE)) .build() CaptchaServletUtil.writeImage(response, captcha.image) } def gradiated = { def captcha = new Captcha.Builder(WIDTH, HEIGHT) .addText() .addBackground(new GradiatedBackgroundProducer()) .build() CaptchaServletUtil.writeImage(response, captcha.image) }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -