⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 radar.fx

📁 一个为 Java/J2EE生成的最简化CAPTCHA的框架
💻 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 + -