You can convert any component to image. Take screenshot of specific component or screen
π¦ 4.91 KB
π com.jerin.s2b.ComponentToImage
Permissions : WRITE_EXTERNAL_STORAGE
What's New π π Save image to ASD in Android 10 and to External storage in below versions
π Create image of scroll arrangements and screens
Blocks
ConvertToImage Method for convertToImage
component
component
component or screen to create image
saveAs
text
filename or path to save
Created Event raised after image created and saved
filePath
text
complete path to file saved
Sample
ππ½ Download Extension
Feel free to share your thoughts and report bugs
Documentation generated with Getaix.com
12 Likes
Anke
November 30, 2021, 10:36am
2
Jerin_Jacob:
Sample
Means, that saveAs
is the relative path and saves the image in:
/storage/emulated/0/files.jpg
on Android < 10 and in the ASD for Android β₯ 10.
Correct?
2 Likes
Good Extension @Jerin_Jacob
Peter
November 30, 2021, 10:39am
4
I used it this way because you only need permission when Android version < 10.
2 Likes
Yes,
I'm using Qutil class to getExternalStorage ,
Since I'm having confusions with ASD.
Peter
November 30, 2021, 10:46am
6
I really like this extension. Used it several times. For instance here.
Because CoderDojo is celebrating its 10th birthday they have a number of festivities. They also made some special birthday material to play with.
One of the things is a social media profile ribbon. I used that to make the following little app.
[Screenshot_20210802-105021] [Screenshot_20210802-105042] [Screenshot_20210802-105056]
You choose a picture on your phone, select the piece you want to use, press process image and presto you have yourself a nice profile image. The image is saved in β¦
1 Like
Glad to hear that Peter
I was unable to post extensions in AppInventor community.
It says, need approval from moderator
.
However this one is live now.
Thank You
1 Like
Peter
November 30, 2021, 11:24am
9
That is why all extensions have to go through this proces
Submission of new extensions
The community has adopted a new approach to the posting of extensions on the community, and all new extensions are now put through an evaluation process.
We do recognise that you have put a lot of time and effort into creating your extension.
We want you to be able to present your extension in the best condition possible, as bug free as possible, with the best documentation, and the Power Users may provide you with several recommendations of how to improve your exβ¦
1 Like
It's a very good extension Jerin. Would be great if it could save to the shared directory /pictures in Android 10+
See Anke's guide:
From an Android point of view there are an β Internal Storage and an β External Storage .
1. Internal Storage
The Internal Storage can only be accessed with a rooted device.
1.1 The app package is saved in
/data/data/<packageName>/
In order to be able to debug your app, AI2 saves the assets for β Companion on devices with
Android β₯ 10 (API β₯ 29):
/storage/emulated/0/Android/data/edu.mit.appinventor.aicompanion3/files/assets/
Android < 10 :
/storage/emulated/0/Android/data/edu.mitβ¦
1 Like
I found this extension, but I do not want to save it in the device , I want to set it in an image component .picture inside the app .
TIMAI2
May 14, 2024, 12:12pm
13
With that extension you will have to save it as a file first, before you can display it in an image component. You could store these files in a specific directory, then delete them as and when they are no longer required, or if just the one file, keep overwriting it using the same file name.
Taifun
May 14, 2024, 8:35pm
15
Eng_A.Abdelaty:
Nothing saved
Nothing saved or you did not find the file, because it is stored in ASD?
Also which Android version are you using for your tests? Btw. to store something in ASD, no permission is required...
Which filepath do you get in the Created event?
Taifun
Android 13
I didnt find it in the phone gallary
Taifun
May 14, 2024, 9:28pm
17
you can only find those images in the gallery, which are accessible
images in the ASD are not accessible by other apps and the ComponentToImage extension stores the image in the ASD
also if you store a new image in shared storage it will not automatically appear in the gallery... you first have to refresh the gallery... the tools extension offers a GalleryRefresh method for this...
btw. you forgot to answer the question
Taifun
1 Like
Taifun
May 15, 2024, 11:53am
19
If you wang to see the image in the gallery, you have to first cooy or move it to shared storage
Taifun
1 Like
Taifun
May 15, 2024, 7:12pm
21
Well done
Congratulations
Taifun
1 Like