fn load_image(path: &str, size: &MySize) -> Arc<canvas::Canvas> {  
    if cfg!(feature = "debug"){print!("Loading image from:  {} .....", path);}
    match Canvas::from_path(&path) {
        Ok(image) => {
            if cfg!(feature = "debug"){println!(" OK");}
            image
        }
        Err(err) => {
            if cfg!(feature = "debug"){println!("Failed: {} \n Creating new one ", err);}
            Canvas::from_color(size.x, size.y, Color::rgb(255, 255, 255))
        }
    }
}
///Load an image from path if exists, otherwise create new empty canvas
Load an image from path if exists, otherwise create new empty canvas
Load an image from path if exists otherwise create new empty canvas
fn load_image(path: &str, size: &MySize) -> Arc<canvas::Canvas> {  
    if cfg!(feature = "debug"){print!("Loading image from:  {} .....", path);}
    match Canvas::from_path(&path) {
        Ok(image) => {
            if cfg!(feature = "debug"){println!(" OK");}
            image
        }
        Err(err) => {
            if cfg!(feature = "debug"){println!("Failed: {} \n Creating new one ", err);}
            Canvas::from_color(size.x, size.y, Color::rgb(255, 255, 255))
        }
    }
}
fn load_image ( path : & str , size : & MySize ) -> Arc < canvas :: Canvas > { if cfg ! ( feature " " ) { print ! ( " " path ) ; } match Canvas :: from_path ( & path ) { Ok ( image ) => { if cfg ! ( feature " " ) { println ! ( " " ) ; } image } Err ( err ) => { if cfg ! ( feature " " ) { println ! ( " \n " err ) ; } Canvas :: from_color ( size . x , size . y , Color :: rgb ( 255 , 255 , 255 ) ) } } }
Load an image from path if exists, otherwise create new empty canvas
Load an image from path if exists otherwise create new empty canvas
path
&str
size
&MySize
path
&str
size
&MySize