1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

README.md: new images, better text (#3392)

* Update images in README.md

* Add ferris image to hello_world example

* Clean up and improve README.md, with top-level link to Rerun

* Move sections around
This commit is contained in:
Emil Ernerfeldt
2023-09-26 21:17:43 +02:00
committed by GitHub
parent 23ce4e70ca
commit dff52eddfd
8 changed files with 77 additions and 43 deletions

View File

@@ -12,4 +12,8 @@ publish = false
eframe = { path = "../../crates/eframe", features = [
"__screenshot", # __screenshot is so we can dump a screenshot using EFRAME_SCREENSHOT_TO
] }
# For image support:
egui_extras = { path = "../../crates/egui_extras", features = ["image"] }
env_logger = "0.10"

View File

@@ -11,7 +11,12 @@ fn main() -> Result<(), eframe::Error> {
eframe::run_native(
"My egui App",
options,
Box::new(|_cc| Box::<MyApp>::default()),
Box::new(|cc| {
// This gives us image support:
egui_extras::install_image_loaders(&cc.egui_ctx);
Box::<MyApp>::default()
}),
)
}
@@ -43,6 +48,10 @@ impl eframe::App for MyApp {
self.age += 1;
}
ui.label(format!("Hello '{}', age {}", self.name, self.age));
ui.image(egui::include_image!(
"../../../crates/egui/assets/ferris.png"
));
});
}
}

View File

@@ -12,7 +12,7 @@ fn main() -> Result<(), eframe::Error> {
"Image Viewer",
options,
Box::new(|cc| {
// The following call is needed to load images when using `ui.image` and `egui::Image`:
// This gives us image support:
egui_extras::install_image_loaders(&cc.egui_ctx);
Box::<MyApp>::default()
}),