Edit image and save to the gallery

Hi everyone, I need some help. I have to create an app that does the following things:

  1. Take a photo
  2. Give the photo a specific name
  3. Write a line of text on the photo
  4. Save the edited photo to the gallery

I was able to do steps 1 and 2, but I can't move forward.
The final result I get is the photo saved in the gallery with the correct name, but without the text overlaid on the image.
For example, the "SaveText" block correctly writes the line of text on the image component, but it doesn't save the edited image to the gallery.

I'm attaching screenshots of my app.



use the GalleryRefresh method from the tools extension

for some examples about how to use that method search the community

Taifun

It doesn't work. The final photo doesn't have the text overlay.

Try the GalleryRefresh method at the very end after moving the file to shared storage

Taifun

Or you could try to use canvas component, It has a write text feature built into it. And combined with the KIO4 Pdf extension you can do all the steps you have in a smaller amount of blocks.
_Junko

I've already tried, it doesn't work.

The canvas component has a very low limit for height and width. If I put an image inside, it loses a lot of quality (I've already tried — in this case the text works, but the quality is not acceptable).

Show us your updated blocks
Does the image displayed in the image component have the watermark?

Taifun


it doesn't work


it doesn't work


it doesn't work

You forgot to tell us

And obviously you should do a gallery refresh of the file in the target directory, in your case inckuding the upcase block

Taifun

Use the companion app and Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

I am not sure if the extension actually commits the changes to file, it only changes the image component view.

You may need another extension Component To Image to actually save the modified image

Another option may be to export the image view to base64, then save this as a file (the watermark would probably need to be on the same layer for this to work:

ImageToBase64

Base64Convertor

1 Like