B4J Question Base64

XbNnX_507

Active Member
Licensed User
B4X:
    Dim img As Image =    canvas.Snapshot2 ( fx.Colors.Transparent ) '<- canvas to image
    Dim out As OutputStream
    out.InitializeToBytesArray( 0 )
    img.WriteToStream( out )
    Dim encoded As String = su.EncodeBase64( out.ToBytesArray )
    File.WriteString( File.DirApp, "base64Image.txt", encoded ) ' <- creates a textFile 
    Log ( encoded ) '<- show the actual encoded text
     out.Close

Hope it Helps.
 
Upvote 0
Top