Ability to get image paste events
Similar to #1167
Is your feature request related to a problem? Please describe. In some applications I want to develop I need to allow the user to paste images into the application.
Describe the solution you'd like There is https://docs.rs/egui/0.19.0/egui/enum.Event.html Paste(String), perhaps a PasteImage(Image) could be added as well
Describe alternatives you've considered n/a
Additional context From what I understand this would need to be added to winit and however egui does its web support, some advice on this would be helpful as I'm interested in implementing this feature myself
https://crates.io/crates/clipboard-win it seems like this crate supports image copy paste on windows
https://crates.io/crates/arboard also supports image copy/paste, and is cross-platform (except for web).
I think this could be added to egui and eframe with not too much effort. Unless you really need web support for images you can just not implement it there.
The way I would implement it is to make arboard and opt-in feature of eframe, and to add egui::Event::PasteImage(ColorImage) and PlatformOutput::copied_image: Option<ColorImage>.
For eframe
Couldn't we get the images from https://github.com/emilk/egui/blob/f6fa74c66578be17c1a2a80eb33b1704f17a3d5f/crates/eframe/src/web/events.rs#L322-L323
// pseudo code
if data.types() == ["files"] {
let file_list = data.files();
let file = file_list.item(0).unwrap(); // to safe
if file is image {
let egui_event = egui::Event::PasteImage(file);
}
}