I am writing simple drawing app in Kivy. It works fine on iPhone and iPad butWindow.screenshot()
returns only a black screen. What did I wrong? Also, is there a way so that the screenshot() gets saved directly on dropbox/iCloud/Files-App?
class DrawInput(Widget):
def btn_save(self):
user_data_dir = App.get_running_app().user_data_dir
name = join(user_data_dir, "filename.png")
Window.screenshot(name)
def on_touch_down(self, touch):
with self.canvas:
Color(0, 0, 0)
touch.ud["line"] = Line(points = (touch.x, touch.y))
def on_touch_move(self, touch):
touch.ud["line"].points += (touch.x, touch.y)
def on_touch_up(self, touch):
pass
presentation = Builder.load_file("app_kivy.kv")
class drawingapp(App):
def build(self):
return presentation
if __name__=="__main__":
drawingapp().run()
Kivy:-
Screen:
name: "drawing"
on_pre_enter: drawing.canvas.clear()
FloatLayout:
DrawInput:
id: drawing
Button:
text: "finish"
on_press: drawing.btn_save()
I expect to get a screenshot of the drawing.