The save_png() function works for desktop app on Windows, but not on Android 🙁

Is there a way to save a screenshot to my android files?

dandorf changed the title to Screenshot not working in Godot 4? (ANDROID) .

DaveTheCoder
I have this code and I have tried different routes but nothing... it doesn't work for me 🙁.

I have these permissions checked (just in case)

Access Network State
Access WiFi Status
Camera
Internet
Manage External Storage
Read External Storage
Write External Storage

   ```

var image = get_viewport().get_texture().get_image()

#print(OS.get_system_dir(OS.SYSTEM_DIR_PICTURES))
DirAccess.make_dir_recursive_absolute("myphoto.png")

image.save_png(OS.get_system_dir(OS.SYSTEM_DIR_PICTURES).path_join("myphoto.png"))
image.save_png(OS.get_system_dir(OS.SYSTEM_DIR_PICTURES).path_join("/myphoto.png"))
image.save_png("storage/DCIM/Camera/myphoto.png") #/storage/emmc/DCIM
image.save_png("/storage/DCIM/Camera/myphoto.png")
image.save_png("/storage/emmc/DCIM/myphoto.png") 


Maybe I'm putting the path wrong, but I don't know how to put it.

I would like the image to appear in the Gallery, within the Camera folder
  • Toxe replied to this.

    dandorf Does taking the screenshot not work or saving the file? Did you try saving another file to that path? Maybe you don't have permission.

      Toxe Saving the image does not work.

      Since if I launch the application in Windows, it saves the screenshot in "Images"

      The problem is when trying to save on my Android phone.