Function make_image

Source
pub fn make_image<F: FnOnce(&mut Graphics<'_>)>(
    width: usize,
    height: usize,
    method: F,
) -> Result<Image, GraphicsError>
Expand description

Create an image widthxheight px and then run drawing commands on it

ยงUsage

let image: Result<Image, GraphicsError> = make_image(30, 30, |g| {
   g.clear(BLACK);
   g.draw_rect(Rect::new(coord!(0,0), coord!(29,29)), stroke(WHITE))
});