1

so I'm trying to make an application using pygame that requires image imports. I already know how to import an image using its path with pygame.image.import but it may be hard for the user to type or find the path of the image every time. so I have 2 options: 1- using a drag and drop system so that the user can drag the image from their desktop/ file explorer to the main window. 2- or the user can open the image themselves and my app would take a screenshot of it and import that. but i neither know how to take a screenshot using pygame nor how to take it when the window is minimized.

can someone guide me?

NinjaFaraz
  • 31
  • 3
  • Would using [TKinter](https://docs.python.org/3/library/dialog.html#module-tkinter.filedialog) possibly be useful to you? – OctaveL Nov 10 '20 at 08:56
  • Drag and Drop support is not very good under PyGame. At the time of writing, MacOS supports the event `USEREVENT_DROPFILE` since PyGame v1.9.2. Unix/X11 variants have `DROPFILE` in PyGame 2.0.0. So if you need multi-os support, you'll need to create your own file-open control, or use some other more portable method. – Kingsley Nov 10 '20 at 21:51

0 Answers0