?? radar.fx
字號:
/* * Radar.fx * * Created on Jan 4, 2009, 8:59:52 PM */package simplecaptcha;import nl.captcha.backgrounds.GradiatedBackgroundProducer;import nl.captcha.Captcha;import javafx.animation.Interpolator;import javafx.animation.KeyFrame;import javafx.animation.Timeline;import javafx.scene.image.Image;import javafx.scene.image.ImageView;import javafx.scene.Scene;import javafx.scene.shape.Arc;import javafx.scene.shape.ArcType;import javafx.scene.text.Font;import javafx.scene.text.Text;import javafx.scene.text.TextAlignment;import javafx.stage.Stage;/** * Builds a CAPTCHA and displays it "radar style" * * @author <a href="james.childers@gmail.com">James Childers</a> */var width = 250;var height = width;var startAngle = 0;def captcha =new Captcha.Builder(width, height) .addText() .gimp() .addNoise() .addNoise() .addBackground(new GradiatedBackgroundProducer()).build();Timeline { repeatCount: Timeline.INDEFINITE autoReverse: false keyFrames: [KeyFrame{ time: 0s values: startAngle => 360}, KeyFrame{ time: 4s values: startAngle => 0 tween Interpolator.LINEAR} ]//keyFrames}.play();Stage { title: "Radar CAPTCHA" width: width height: height scene: Scene { content: [ ImageView { clip: bind Arc { centerX: width / 2 centerY: 100 radiusX: width radiusY: height startAngle: startAngle length: 90 type: ArcType.ROUND } image: Image.fromBufferedImage(captcha.getImage()) } Text { font: Font { size: 16 } x: 10, y: height - 50 textAlignment: TextAlignment.CENTER content: "Answer: {captcha.getAnswer()}" } ] }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -