Custom ImageView to generate captcha image.

Overview

CaptchaImageView

Github All Releases Android Arsenal

Custom ImageView to generate captcha image.

Output sample Output sample

Add CaptchaImageView to your layout

 <test.jinesh.captchaimageviewlib.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()

Use in your project

1.Add it in your root build.gradle at the end of repositories:

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

2.Add the dependency in your app build.gradle file:

dependencies {
	        compile 'com.github.jineshfrancs:CaptchaImageView:1.0'
}
You might also like...
Implementation of ImageView for Android that supports zooming, by various touch gestures.
Implementation of ImageView for Android that supports zooming, by various touch gestures.

PhotoView PhotoView aims to help produce an easily usable implementation of a zooming Android ImageView. [ Dependency Add this in your root build.grad

A circular ImageView for Android
A circular ImageView for Android

CircleImageView A fast circular ImageView perfect for profile images. This is based on RoundedImageView from Vince Mi which itself is based on techniq

Adds touch functionality to Android ImageView.

TouchImageView for Android Capabilities TouchImageView extends ImageView and supports all of ImageView’s functionality. In addition, TouchImageView ad

Android ImageView widget with zoom and pan capabilities

ImageViewTouch for Android ImageViewTouch is an android ImageView widget with zoom and pan capabilities. This is an implementation of the ImageView wi

ImageView and FrameLayout with gestures control and position animation
ImageView and FrameLayout with gestures control and position animation

GestureViews ImageView and FrameLayout with gestures control and position animation. Main goal of this library is to make images viewing process as sm

Implements pinch-zoom, rotate, pan as an ImageView for Android 2.1+

GestureImageView This is a simple Android View class which provides basic pinch and zoom capability for images. Can be used as a replacement for a sta

Android ImageView that handles animated GIF images
Android ImageView that handles animated GIF images

GifImageView Android ImageView that handles Animated GIF images Usage In your build.gradle file: dependencies { compile 'com.felipecsl:gifimageview:

Android ImageView that supports different radii on each corner.
Android ImageView that supports different radii on each corner.

SelectableRoundedImageView Note that this project is no longer maintained. Android ImageView that supports different radii on each corner. It also sup

ImageView with a tag on android
ImageView with a tag on android

SimpleTagImageView ImageView with a tag in android. So it's a ImageView. Demo ####Warning:When you set the round radius,the simpletagimageview scale t

Comments
  • CaptchaImageView Exception

    CaptchaImageView Exception

    Hi,

    I tried using the class for my project, but when i run the application it crashes. *****This is my call

                <Button
                    android:id="@+id/btnCaptchaRefresh"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentRight="true"
                    android:layout_marginLeft="3dp"
                    android:layout_marginStart="3dp"
                    android:background="@drawable/synchronization1"
                    android:onClick="refreshCaptcha" />
        <FrameLayout 
            android:id="@+id/flCaptchaContainer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_toLeftOf="@+id/btnCaptchaRefresh" >                        
            <com.mjc.activity.common.CaptchaImageView
                       android:id="@+id/ivCaptcha"
                       android:layout_width="fill_parent"
                       android:layout_height="50dp"
    		           android:scaleType="fitXY"
                    	    android:layout_marginLeft="7dp"
                           android:adjustViewBounds="true" />
          </FrameLayout>
    

    ..........................

    *****This is the stack trace i am getting. 07-26 18:55:22.466: E/AndroidRuntime(5511): FATAL EXCEPTION: main 07-26 18:55:22.466: E/AndroidRuntime(5511): Process: com.mjc.gametime.black, PID: 5511 07-26 18:55:22.466: E/AndroidRuntime(5511): java.lang.IllegalArgumentException: width and height must be > 0 07-26 18:55:22.466: E/AndroidRuntime(5511): at android.graphics.Bitmap.createBitmap(Bitmap.java:810) 07-26 18:55:22.466: E/AndroidRuntime(5511): at android.graphics.Bitmap.createBitmap(Bitmap.java:789) 07-26 18:55:22.466: E/AndroidRuntime(5511): at android.graphics.Bitmap.createBitmap(Bitmap.java:756) 07-26 18:55:22.466: E/AndroidRuntime(5511): at com.mjc.activity.common.CaptchaImageView$CaptchaGenerator.regenerate(CaptchaImageView.java:138) 07-26 18:55:22.466: E/AndroidRuntime(5511): at com.mjc.activity.common.CaptchaImageView$CaptchaGenerator.access$0(CaptchaImageView.java:127) 07-26 18:55:22.466: E/AndroidRuntime(5511): at com.mjc.activity.common.CaptchaImageView.draw(CaptchaImageView.java:36) 07-26 18:55:22.466: E/AndroidRuntime(5511): at com.mjc.activity.common.CaptchaImageView.reDraw(CaptchaImageView.java:111) 07-26 18:55:22.466: E/AndroidRuntime(5511): at com.mjc.activity.common.CaptchaImageView.onWindowFocusChanged(CaptchaImageView.java:256) 07-26 18:55:22.466: E/AndroidRuntime(5511): at android.view.View.dispatchWindowFocusChanged(View.java:8681) 07-26 18:55:22.466: E/AndroidRuntime(5511): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1060) 07-26 18:55:22.466: E/AndroidRuntime(5511): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1060) 07-26 18:55:22.466: E/AndroidRuntime(5511): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1060) 07-26 18:55:22.466: E/AndroidRuntime(5511): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1060) 07-26 18:55:22.466: E/AndroidRuntime(5511): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1060) 07-26 18:55:22.466: E/AndroidRuntime(5511): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1060) 07-26 18:55:22.466: E/AndroidRuntime(5511): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1060) 07-26 18:55:22.466: E/AndroidRuntime(5511): at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:1060) 07-26 18:55:22.466: E/AndroidRuntime(5511): at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3302) 07-26 18:55:22.466: E/AndroidRuntime(5511): at android.os.Handler.dispatchMessage(Handler.java:102) 07-26 18:55:22.466: E/AndroidRuntime(5511): at android.os.Looper.loop(Looper.java:135) 07-26 18:55:22.466: E/AndroidRuntime(5511): at android.app.ActivityThread.main(ActivityThread.java:5282) 07-26 18:55:22.466: E/AndroidRuntime(5511): at java.lang.reflect.Method.invoke(Native Method) 07-26 18:55:22.466: E/AndroidRuntime(5511): at java.lang.reflect.Method.invoke(Method.java:372) 07-26 18:55:22.466: E/AndroidRuntime(5511): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 07-26 18:55:22.466: E/AndroidRuntime(5511): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

    opened by EJosef 5
Releases(1.0)
Owner
Jinesh Francis
Android Developer
Jinesh Francis
Big image viewer supporting pan and zoom, with very little memory usage and full featured image loading choices. Powered by Subsampling Scale Image View, Fresco, Glide, and Picasso. Even with gif and webp support! 🍻

BigImageViewer Big image viewer supporting pan and zoom, with very little memory usage and full featured image loading choices. Powered by Subsampling

Piasy 3.9k Dec 30, 2022
Android ImageView replacement which allows image loading from URLs or contact address book, with caching

Smart Image View for Android SmartImageView is a drop-in replacement for Android’s standard ImageView which additionally allows images to be loaded fr

James Smith 1.3k Dec 24, 2022
Flickable ImageView for Android. It's like a view of twitter's detail image.

FlickableView Flickable ImageView for Android. It's like a view of twitter's detail image. It's possible that other views animate with FlickableView.

goka 153 Nov 14, 2022
A library for Android provides blurred drop shadows to ImageView similar to iOS image backdrop shadows

A library for Android provides blurred drop shadows to ImageView similar to iOS image backdrop shadows.Provides fast canvas draw as no renderscript needed .The similar shadow blurred effects can also be seen in iOS Music App.

Vivek Verma 163 Dec 31, 2022
Android library to generate image avatar from the first letter of a username. Letter avatar like Gmail Android best practice

AvatarImageGenerator Generate first letter avatar Image like gmail's contact avatar. It generates an drawable that can be be set to an ImageView. Inst

Korir Amos 61 Sep 25, 2022
Custom shaped android imageview components

Shape Image View Provides a set of custom shaped android imageview components, and a framework to define more shapes. Implements both shader and bitma

Siyamed SINIR 2.6k Mar 29, 2021
Custom ImageView for android with polygon shape (Android)

PolygonImageView Create a custom ImageView with polygonal forms. Usage To use PolygonImageView, add the module into your project and start to build xm

Albert Grobas 531 Dec 25, 2022
Image Picker with Customizable UI for Android, Pick an image from Gallery

Image Picker A Image Picker Library for Android (Supports Android 12) with fully

null 2 May 29, 2022
Slider-Gallery-Zoom: image slider for android supporting indicator and auto scroll with clicking on image

image slider supporting indicator and auto scroll with clicking on image to open full screen image slider swipe and pinch zoom gestures like gallery,just pass your images and the position of the current image.

Mahmoud Elian 3 May 28, 2022