Skip to content

Latest commit

 

History

History
25 lines (15 loc) · 731 Bytes

drawing_crosses.md

File metadata and controls

25 lines (15 loc) · 731 Bytes

Drawing Crosses

The draw_cross_mut function draws five pixels that look like a cross on an image.

use imageproc::{drawing, image};

fn main() {
    let mut buf = image::ImageBuffer::new(100, 100);

    drawing::draw_cross_mut(&mut buf, image::Rgb::from([128u8, 255u8, 64u8]), 50, 50);

    buf.save("cross.png").unwrap();
}

cross.png:

cross

To draw a cross on a copied image, we can use draw_cross.

➡️ Next: Drawing Cubic Bezier Curves

📘 Back: Table of contents