Comment effacer des images (How do you delete images?)

bonjour, dans mon application j'ai un bouton télécharger l'image et un bouton supprimer l'image , mais comment faire avec les blocs pour le bouton supprimer ?

are you talking about how to set a button to invisible?
just set the visible property of the button to false

http://ai2.appinventor.mit.edu/reference/components/userinterface.html#Button

Visible

Specifies whether the Button should be visible on the screen. Value is true if the Button is showing and false if hidden.

Taifun

non je ne parle pas du bouton , je parle de l'image

c'est à dire en cliquant sur le bouton je veux supprimer l'image

use the file component to delete the image
http://ai2.appinventor.mit.edu/reference/components/storage.html#File

Delete(fileName)

Deletes a file from storage. Prefix the fileName with / to delete a specific file in the SD card (for example, /myFile.txt will delete the file /sdcard/myFile.txt). If the fileName does not begin with a /, then the file located in the program’s private storage will be deleted. Starting the fileName with // is an error because asset files cannot be deleted.

Taifun

Use the TaifunFile extension (especially on Android 11+) if you do not want to request and grant storage permissions (because you do not need them for images / files created by the app itself).

non je ne veux pas demander d'autorisation, mais avez vous des exemples avec les blocs ?

Show your relevant blocks (for saving / downloading the image).

je ne les ai pas


j'ai fais ça et maintenant je voudrais supprimer en cliquant sur un bouton

it would have been nice to switch the language to
english before taking a screenshot...

these blocks do not make sense... remove them...

also it looks like you do not download images, you pick images using the image picker, isn't it?
so after picking an image you like to delete it from the device?

Taifun

1 Like

Also you topic ("Comment effacer des images") doesn't make sense.

oui Taifun c'est ce que je souhaite faire , supprimer une image

It sounds simple, but unfortunately it is not simple to delete an image your app does not own...

You will have to use SAF

Taifun

j'ai une image car je la télécharge et ensuite je veux la supprimer

In your screenshot you are using an image picker... you did NOT download an image, at least not in your screenshot ..

You might want to read again how to ask questions so we do not have to continue guessing...

Taifun

le problème c'est que je ne suis pas experte dans appinventor, je débute. Donc j'essai aussi de comprendre vos réponse c'est pas évident pour moi.
Ma question est : comment je peux faire pour supprimer une image que j'ai téléchargée , je ne veux pas en retélécharger une autre je veux que l'emplacement soit vide

to delete from the folder you downloaded the file image to. There is not a simple way to do this.

You probably need to use SAF and this Block:
deleteSAF

It seems that you understand "download" differently than we do. Download means that a file/image has been downloaded to your device via a URL address (from the internet).

non pas sur internet , téléchargé dans ma galerie du téléphone