Final image API doc tweaks
This commit is contained in:
parent
cfbad1f865
commit
9a947e5547
|
|
@ -160,13 +160,11 @@ fn run_and_return(
|
|||
// Platform-dependent event handlers to workaround a winit bug
|
||||
// See: https://github.com/rust-windowing/winit/issues/987
|
||||
// See: https://github.com/rust-windowing/winit/issues/1619
|
||||
#[cfg(target_os = "windows")]
|
||||
winit::event::Event::RedrawEventsCleared => {
|
||||
winit::event::Event::RedrawEventsCleared if cfg!(target_os = "windows") => {
|
||||
next_repaint_time = extremely_far_future();
|
||||
winit_app.run_ui_and_paint()
|
||||
}
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
winit::event::Event::RedrawRequested(_) => {
|
||||
winit::event::Event::RedrawRequested(_) if !cfg!(target_os = "windows") => {
|
||||
next_repaint_time = extremely_far_future();
|
||||
winit_app.run_ui_and_paint()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -448,7 +448,8 @@ pub fn warn_if_debug_build(ui: &mut crate::Ui) {
|
|||
/// ui.image(egui::include_image!("../assets/ferris.png"));
|
||||
/// ui.add(
|
||||
/// egui::Image::new(egui::include_image!("../assets/ferris.png"))
|
||||
/// .rounding(egui::Rounding::same(6.0))
|
||||
/// .max_width(200.0)
|
||||
/// .rounding(10.0),
|
||||
/// );
|
||||
///
|
||||
/// let image_source: egui::ImageSource = egui::include_image!("../assets/ferris.png");
|
||||
|
|
|
|||
|
|
@ -1560,7 +1560,8 @@ impl Ui {
|
|||
/// ui.image(egui::include_image!("../assets/ferris.png"));
|
||||
/// ui.add(
|
||||
/// egui::Image::new(egui::include_image!("../assets/ferris.png"))
|
||||
/// .rounding(egui::Rounding::same(6.0))
|
||||
/// .max_width(200.0)
|
||||
/// .rounding(10.0),
|
||||
/// );
|
||||
/// # });
|
||||
/// ```
|
||||
|
|
|
|||
|
|
@ -42,7 +42,8 @@ http = ["dep:ehttp"]
|
|||
##
|
||||
## You also need to ALSO opt-in to the image formats you want to support, like so:
|
||||
## ```toml
|
||||
## image = { version = "0.24", features = ["jpeg", "png"] }
|
||||
## image = { version = "0.24", features = ["jpeg", "png"] } # Add the types you want support for
|
||||
|
||||
## ```
|
||||
image = ["dep:image"]
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ One thing `egui_extras` is commonly used for is to install image loaders for `eg
|
|||
|
||||
```toml
|
||||
egui_extras = { version = "*", features = ["all_loaders"] }
|
||||
image = { version = "0.24", features = ["jpeg", "png"] }
|
||||
image = { version = "0.24", features = ["jpeg", "png"] } # Add the types you want support for
|
||||
```
|
||||
|
||||
```rs
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
///
|
||||
/// ```toml,ignore
|
||||
/// egui_extras = { version = "*", features = ["all_loaders"] }
|
||||
/// image = { version = "0.24", features = ["jpeg", "png"] }
|
||||
/// image = { version = "0.24", features = ["jpeg", "png"] } # Add the types you want support for
|
||||
/// ```
|
||||
///
|
||||
/// ⚠ You have to configure both the supported loaders in `egui_extras` _and_ the supported image formats
|
||||
|
|
|
|||
|
|
@ -29,8 +29,7 @@ impl eframe::App for MyApp {
|
|||
ui.image(egui::include_image!("ferris.svg"));
|
||||
|
||||
ui.add(
|
||||
egui::Image::new("https://picsum.photos/seed/1.759706314/1024")
|
||||
.rounding(egui::Rounding::same(10.0)),
|
||||
egui::Image::new("https://picsum.photos/seed/1.759706314/1024").rounding(10.0),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue