use quicksilver::{
geom::{Rectangle, Vector},
graphics::{Color, Image},
run, Graphics, Input, Result, Settings, Window,
};
fn main() {
run(
Settings {
title: "Image Example",
..Settings::default()
},
app,
);
}
async fn app(window: Window, mut gfx: Graphics, mut input: Input) -> 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(_) = input.next_event().await {}
}
}