Canvas are not saved

I saved the canvas using the code in the picture below. However, it is not displayed in the device's gallery. What's the problem? Please help me.
image

pls use taifun's tools extension to refresh gallery.

The Save method for the canvas differs between devices. In your instance, the canvas is not saved in your gallery, but in your internal storage. To save an image in the phone's gallery app, use this extension from @Taifun.

I have this tool extension. I'll try using it.

1 Like

But, even if you use the extension function, it is not displayed in the gallery. Why did you do that? Please let me know another solution or extension to save images.

Please show us your relevant blocks for using the extension.

you need write external storage permission to save images to gallery.
also you are using call ••••••••••• .Save wrong. to use it,

  1. you have to use TinyDB (to save the image in data base like this: )
  2. or use Tools Extension from @Taifun ( to save the image to gallery)(write external storage permission needed)

This will only save the path as a string to the tinydb. How does this help ?

1 Like

That's right. Even if you use this method, you won't see an image in the gallery. The same is true of Taifun's extension. I want a definite solution.

You could always try this:

1 Like

See also here: How to ask a question (open new topic)

And post a test aia (with English blocks).

1 Like

Yes, I will upload the AIA file.
CanvasSaveTest.aia (1.7 KB)

I don't said TinyDB will help to save the image to gallery. I just suggested that with this way, we can see the canvas in the App later if we want.

So how can I store the canvas in the gallery?

1, store it in a shared directory, see the overview here Some basics on Android storage system - #34 by Anke
and 2. use the GalleryRefresh method from the tools extension App Inventor Extensions: Tools | Pura Vida Apps

Taifun

1 Like

(1) The image must be saved in the Shared folder /DCIM/ (or a sub-folder) to be displayed in the Gallery (Photos), especially on Android 11+.
(2) In addition:

Tested on Android 9, 11 and 12.

Example (folder / rel. path → /DCIM/Canvas/myImage.jpg):

Note: On Android 9 (< 10) it also works with /Pictures/ or /Download/`, but not on Android 11+.

3 Likes