B4A Library ASCII-Art-Generator

somed3v3loper

Well-Known Member
Licensed User
Hello all

a wrap for this library https://github.com/zelin/ASCII-Art-Generator



ASCIIConverter
Author:
SMM
Version: 0.01
  • ASCIIConverter
    Events:
    • _stringready (data As string)
    • _bitmapready (data As bitmap )
    Methods:
    • createASCIIString (bitmap As android.graphics.Bitmap) As void
    • createASCIIImage (bitmap As android.graphics.Bitmap) As void
    • IsInitialized As boolean
    • Initialize (ba As anywheresoftware.b4a.BA, EventName As java.lang.String, map As anywheresoftware.b4a.objects.collections.Map) As void
    Properties:
    • GrayScale As boolean [write only]
    • ReversedLuminance As boolean [write only]
    • FontSize As int [write only]

Sample

B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Dim ac As ASCIIConverter
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    Dim map As Map
   
    map.Initialize
'    map.put(" ", 1.0f)
'    map.put("`", 0.95f)
'    map.put(",", 0.9f)
    map.put(".", 0.8f)
'    map.put("+", 0.7f)
'    map.put("<", 0.65f)
'    map.put("o", 0.55f)
'    map.put("=", 0.5f)
'    map.put("%", 0.3f)
'    map.put("@", 0.0f)
    ac.Initialize("ac",Null)
    ac.FontSize=5
    ac.createASCIIImage(LoadBitmap(File.DirAssets,"apple.png"))
    ac.createASCIIString(LoadBitmap(File.DirAssets,"apple.png"))
End Sub
Sub ac_bitmapready(data As Bitmap)
    Activity.SetBackgroundImage(data)
End Sub
Sub ac_stringready(data As String)
    Log(data)
End Sub
Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
 

Attachments

Top