B4A Library ScratchView V1.5

This is a wrap for this github project.

V1.5 needs B4A 6+ as the resources are now inside an aar.

ScratchView
Author:
DonManfred (wrapper)
Version: 1.5
  • ScratchImageView
    Events:
    • PercentRevealed (percent As Double)
    • onRevealed ( As )
    • onScratching (Scratched As Boolean)
    Fields:
    • ba As BA
    Methods:
    • BringToFront
    • 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
    • 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)
    • clear
      clears the scratch area to reveal the hidden image.
    • isRevealed As Boolean
    • setEraserMode
    Properties:
    • Background As Drawable
    • Color As Int
    • Enabled As Boolean
    • ErasePaint As Paint [read only]
    • Height As Int
    • ImageBounds() As Int [read only]
    • ImageDrawable As Drawable [write only]
    • ImageResource As String [write only]
    • Left As Int
    • Parent As Object [read only]
    • StrokeWidth As Int [write only]
      Set the strokes width based on the parameter multiplier.
    • Tag As Object
    • Top As Int
    • Visible As Boolean
    • Width As Int
  • ScratchTextView
    Events:
    • PercentRevealed (percent As Double)
    • onRevealed ( As )
    • onScratching (Scratched As Boolean)
    Fields:
    • ba As BA
    Methods:
    • BringToFront
    • 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
    • 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)
    • isRevealed As Boolean
    • reveal
      Reveals the hidden text by erasing the scratch area.
    Properties:
    • Background As Drawable
    • Color As Int
    • Enabled As Boolean
    • Height As Int
    • Left As Int
    • Parent As Object [read only]
    • StrokeWidth As Int [write only]
      Set the strokes width based on the parameter multiplier.
    • Tag As Object
    • Text As String
    • TextColor As Int [write only]
    • TextColor2 As ColorStateList
    • TextSize As Float
    • Top As Int
    • Visible As Boolean
    • Width As Int

scratch_image_view_demo.gif
scratch_text_view_demo.gif
 

Attachments

  • ScratchViewV1.0.0.zip
    19 KB · Views: 417
  • ScratchViewV1.0.1.zip
    19.6 KB · Views: 417
  • ScratchViewV1.2.zip
    20.6 KB · Views: 442
  • ScratchViewEx.zip
    13.7 KB · Views: 505
  • ScratchViewV1.5.zip
    33.7 KB · Views: 898
Last edited:

EduardoElias

Well-Known Member
Licensed User
Longtime User
using b4a 9.5 with version 1.2 of this library I get this compiling the example:

upload_2019-10-9_7-12-45.png


using the library version 1.5 it compiles but crashes with this:
upload_2019-10-9_7-16-39.png


I know the library is lost, but i am trying to make a proof of concept and could help, any ideias?
 

DonManfred

Expert
Licensed User
Longtime User
1. You should ALWAYS(!!) create a new thread in the questionsforum for any issue you have.
2. Post errors as TEXT as it is text. Screenshots are less readable (and NOT copyable at all).
3. Make sure to post a small example project which shows the issue
 
Last edited:
Top