use quicksilver::{
geom::{Rectangle, Vector},
graphics::{Color, Graphics, Image},
lifecycle::{run, EventStream, Settings, Window},
Result,
};
fn main() {
run(
Settings {
size: Vector::new(800.0, 600.0).into(),
title: "Image Example",
..Settings::default()
},
app,
);
}
async fn app(window: Window, mut gfx: Graphics, mut events: EventStream) -> Result<()> {
let image = Image::load(&gfx, "image.png").await?;
gfx.clear(Color::WHITE);
let region = Rectangle::new(Vector::new(100.0, 100.0), image.size());
gfx.draw_image(&image, region);
gfx.present(&window)?;
loop {
while let Some(_) = events.next_event().await {}
}
}