open and display image

This commit is contained in:
Zynh0722 2024-05-12 18:34:06 -07:00
parent 9592a5dc27
commit fc87ea8835
2 changed files with 13 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 701 KiB

After

Width:  |  Height:  |  Size: 212 KiB

View file

@ -1,3 +1,14 @@
fn main() {
println!("Hello, world!");
use std::error::Error;
use image::io::Reader as ImageReader;
use imageproc::window::display_image;
fn main() -> Result<(), Box<dyn Error>> {
let img = ImageReader::open("./assets/Xbox_Controller_Blank.png")?.decode()?;
let img = img.into_rgba8();
// println!("{:?}",);
display_image("Image", &img, 150, 151);
Ok(())
}