๐Ÿ–ผ Base64 Tools - four little ones ;)

These three simple individual extensions are already rolled into Juan's Base64 extension, but I believe it may be useful to some to have access to individual functions for specific needs....

There is now a fourth little one, not included in Juan's extension, for the Canvas ImageSprite.

Image To/From Base64
This extension has two functions, the first will convert whatever image is in an image component to a base64 string, the second will load a base64 string to an image component. There is an After Conversion to Base64 event as well

Blocks
imgasb64blocks
Usage
imgB64usage
AIX
ImageToBase64

JAVA
ImageBase64.java.txt (2.4 KB)

Canvas To Base64
This extension has the one function, working much the same as canvas saveas, but converting the canvas image to base64. There is an After Conversion event

Blocks
canvasB64blocks

Usage
canvB64usage

Updated: 2023-09-27T23:00:00Z, due to changes in code

AIX
CanvasToBase64

JAVA
CanvasBase64.java.txt (1.7 KB)

Camera Picture to Base64
This extension will allow the user to take a picture with their camera, and to then return the thumbnail image of the picture taken as a base64 string. There is an After Picture Taken / Conversion event.

Blocks
camasB64blocks

Usage
camB64usage

AIX
CameraToBase64

JAVA
CameraBase64.java.txt (2.6 KB)

Video

Base64 to ImageSprite
An extra one, created by @Kevinkun to set an imageSprite Picture from a base64 string
cn.kevinkun.SpriteBase64.aix (4.6 KB)

Credits
My thanks to @shreyash, @Kumaraswamy, @vknow360, @Juan_Antonio for their help and support in creating these extensions
My thanks to @shreyash for the RUSH extension builder

Available for use in any MIT AppInventor projects or competitions

#####################################################################
This work by TIMAI2 is licensed under a
Creative Commons Attribution-ShareAlike 4.0 Unported License with attribution.
Please use name = TIMAI2 and link to this source page when giving credit.
#####################################################################

18 Likes

Great @TimAI2 !, so the blocks are very clear and easy to understand.

6 Likes

Wow, you are Incredible

:scream: :exploding_head: :innocent:

1 Like

Wow! very nice extension

2 Likes

Nice extetion @TIMAI2

1 Like

A nice one @TIMAI2
:wink:

2 Likes

Well @TIMAI2 you have a lot of fans here i see :wink:

Maybe you could also do a Base45?

7 Likes

Epic work๐Ÿ˜

2 Likes
3 Likes

Hi @TIMAI2 , are you able to share the source code for these extensions? It would be very appreciated.

1 Like

Now added to the first post :+1:

2 Likes

Update

Fourth extension added, as created by @Kevinkun to set an ImageSprite.Picture from a base64 string.

This is added to the first post.

can we have a base64 to canvas background?
will that solve "save canvas to image, set image as canvas background,and bg become more and more blur" issue?

Already there natively....

image

Alternatively

Base64 Image to Component

1 Like

how can i get the image path after "base64 to image" ??
aabbcc
For this block i need path

aabbcc2

in this way,it doesn't work

There is no path or file, just the base64.

You will need to save the converted base64 string to a file, then use that path.

2 Likes

thanks

That's really useful,thank you.lol