cursive-image 0.0.6

Image view for the Cursive TUI library
Documentation
use {
    cursive::{views::*, *},
    cursive_image::*,
};

// PNG is natively supported by the terminal and is thus the most efficient format
const FILE: &str = "assets/media/linux.png";

fn main() {
    let mut cursive = default();

    // By default the image view uses "shrink" sizing

    cursive.add_layer(Panel::new(ImageView::default().with_image(Image::new_file(
        FILE,
        false,
        ImageFormat::PNG,
        (96, 96),
    ))));

    cursive.add_global_callback('q', |cursive| cursive.quit());

    cursive.run();
}