B4A Library CaptchaView

Use this for captcha challenge in your applications...
CaptchaView
Version:
0.2
  • CaptchaView
    Fields:
    • ba As BA
  • Methods:
    • AddToParent (Parent As ViewGroup, left As Int, top As Int, width As Int, height As Int)
    • BringToFront
    • Capture
    • DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
    • Initialize (EventName As String)
    • Invalidate
    • Invalidate2 (arg0 As Rect)
    • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • IsInitialized As Boolean
    • Refresh
      refresh captcha string
    • RemoveView
    • RequestFocus As Boolean
    • SendToBack
    • SetBackgroundImage (arg0 As Bitmap)
    • SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
    • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
    • SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
    • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
    • enableDotBlur (enable As Boolean)
    • enableLineBlur (enable As Boolean)
  • Properties:
    • Background As Drawable
    • Captcha As String [read only]
      get captcha string
    • Color As Int [write only]
    • Enabled As Boolean
    • Height As Int
    • Left As Int
    • Length As Int
      set length
    • Pattern As String
      set captcha pattern
    • Tag As Object
    • Top As Int
    • Visible As Boolean
    • Width As Int
f.png
 

Attachments

  • LIBS.zip
    5.9 KB · Views: 315
  • libExample.zip
    6.9 KB · Views: 301
Last edited:

Daniel-White

Active Member
Licensed User
Longtime User
Thanks for share it, One question, why it is a must use uppercase?, if I am not wrong, usually, the users can answer the captcha in lowercase or uppercase.
 

jahswant

Well-Known Member
Licensed User
Longtime User
Thanks for share it, One question, why it is a must use uppercase?, if I am not wrong, usually, the users can answer the captcha in lowercase or uppercase.
You can solve this by using :
B4X:
If CaptchaView1.Captcha.SubString2(0,CaptchaView1.Length).ToLowerCase  = txtCheck.Text.Trim Then
        ToastMessageShow("Correct Answer",False)       
        Else
        ToastMessageShow("Wrong Answer",False)
        CaptchaView1.Refresh
        txtCheck.Text = ""
    End If
 
Top