Skip to navigation
Set an egui rust application icon
09.02.23
add image crate (0.24.2) image = "0.24.2" add the following code to your rust source: fn load_icon(path: &str) -> eframe::IconData { let (icon_rgba, icon_width, icon_height) = { let image = image::open(path) .expect("Failed to open icon path") .into_rgba8(); let (width, height) = image.dimensions(); let rgba = image.into_raw(); (rgba, width, height) }; eframe::IconData { rgba: icon_rgba, width: icon_width, height: icon_height, } } use it: // window options let options = eframe::NativeOptions { icon_data: Some(load_icon(".\\dll-crab.png")), // an example ..Default::default() };
https://github.com/emilk/egui/discussions/1574
Reply
Anonymous
Information Epoch 1732451348
Allow the user to tailor the environment.
Home
Notebook
Contact us