Search code examples
pythonkivykivy-language

Saving a canvas as an image in kivy to a certain file path specified in filechooserview


I'm creating a drawing app as one of my first kivy projects as a learning experience, and one of the core features on it is a save_as method where you get to save the image you drew on canvas at a specified filepath as a png. I'm using the FileChooserListView built in kivy to get the specified path the user desires, and there is a button that should save the drawing as a png.

I've been having a really hard issue trying to figure this out and wondering if anyone has an idea how this would be possible. I know there is a export_to_png method built in, but that saves to the current directory of where the coding folder is located.

Any sort of ideas would be awesome, thank you


Solution

  • I know there is a export_to_png method built in, but that saves to the current directory of where the coding folder is located.

    It saves to whatever path you give it. If you want to save to a path from the filechooserview, pass that pass as the argument to export_to_png.