summaryrefslogtreecommitdiffstats
path: root/examples/screenshot
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-06-06 16:05:46 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-06-06 16:05:46 +0200
commit7adfaa88a68e1accfaddf13e82b8bd7a11ee8786 (patch)
treee9e7d6608547b0f4db0264758c26bddbc5076cd3 /examples/screenshot
parentc1021c71758d0c850c7b3fea26075bb83830cb7d (diff)
downloadiced-7adfaa88a68e1accfaddf13e82b8bd7a11ee8786.tar.gz
iced-7adfaa88a68e1accfaddf13e82b8bd7a11ee8786.tar.bz2
iced-7adfaa88a68e1accfaddf13e82b8bd7a11ee8786.zip
Avoid `iced_image` import in `screenshot` example
Diffstat (limited to 'examples/screenshot')
-rw-r--r--examples/screenshot/src/main.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/screenshot/src/main.rs b/examples/screenshot/src/main.rs
index 0f1d8dce..66cbcd8c 100644
--- a/examples/screenshot/src/main.rs
+++ b/examples/screenshot/src/main.rs
@@ -1,18 +1,17 @@
+use ::image as img;
+use ::image::ColorType;
use iced::alignment::{Horizontal, Vertical};
use iced::keyboard::KeyCode;
use iced::theme::{Button, Container};
use iced::widget::runtime::{CropError, Screenshot};
use iced::widget::{
- button, column as col, container, image as iced_image, row, text,
- text_input,
+ button, column as col, container, image, row, text, text_input,
};
use iced::{
event, executor, keyboard, subscription, Alignment, Application, Command,
ContentFit, Element, Event, Length, Rectangle, Renderer, Subscription,
Theme,
};
-use image as img;
-use image::ColorType;
fn main() -> iced::Result {
env_logger::builder().format_timestamp(None).init();
@@ -131,7 +130,7 @@ impl Application for Example {
fn view(&self) -> Element<'_, Self::Message, Renderer<Self::Theme>> {
let image: Element<Message> = if let Some(screenshot) = &self.screenshot
{
- iced_image(iced_image::Handle::from_pixels(
+ image(image::Handle::from_pixels(
screenshot.size.width,
screenshot.size.height,
screenshot.bytes.clone(),