freedom-fish/CaptchaImageView

Custom ImageView to generate captcha image.

★ 0Forks 0JavaGitHub ↗Compare

README

CaptchaImageView

Custom ImageView to generate captcha image.

Output sample Output sample

Add CaptchaImageView to your layout

 <test.jinesh.captcha.CaptchaImageView
            android:layout_width="wrap_content"
            android:id="@+id/image"
            android:layout_weight="6"
            android:layout_margin="5dp"
            android:layout_height="50dp"
            />

Call regenerate() method on CaptchaImageView to regenerate your captcha

 captchaImageView= (CaptchaImageView) findViewById(R.id.image);
 refreshButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                captchaImageView.regenerate();
            }
 });

Call getCaptchaCode() method on CaptchaImageView to read last generated captcha code.

 captchaImageView.getCaptchaCode()

Contributors

jineshfrancs

Issues