fix: stroke color

This commit is contained in:
chux0519 2019-11-15 18:51:16 +08:00
parent a822a98bdc
commit 7224c33523

View File

@ -1,4 +1,5 @@
use embedded_graphics::fonts::Font6x8; use embedded_graphics::fonts::Font6x8;
use embedded_graphics::pixelcolor::BinaryColor;
use embedded_graphics::prelude::*; use embedded_graphics::prelude::*;
use embedded_graphics::primitives::{Circle, Line, Rectangle}; use embedded_graphics::primitives::{Circle, Line, Rectangle};
use embedded_graphics::Drawing; use embedded_graphics::Drawing;
@ -14,13 +15,33 @@ fn main() {
disp.init().unwrap(); disp.init().unwrap();
disp.flush().unwrap(); disp.flush().unwrap();
disp.draw(Line::new(Point::new(8, 16 + 16), Point::new(8 + 16, 16 + 16)).into_iter()); disp.draw(
disp.draw(Line::new(Point::new(8, 16 + 16), Point::new(8 + 8, 16)).into_iter()); Line::new(Point::new(8, 16 + 16), Point::new(8 + 16, 16 + 16))
disp.draw(Line::new(Point::new(8 + 16, 16 + 16), Point::new(8 + 8, 16)).into_iter()); .stroke(Some(BinaryColor::On))
.into_iter(),
);
disp.draw(
Line::new(Point::new(8, 16 + 16), Point::new(8 + 8, 16))
.stroke(Some(BinaryColor::On))
.into_iter(),
);
disp.draw(
Line::new(Point::new(8 + 16, 16 + 16), Point::new(8 + 8, 16))
.stroke(Some(BinaryColor::On))
.into_iter(),
);
disp.draw(Rectangle::new(Point::new(48, 16), Point::new(48 + 16, 16 + 16)).into_iter()); disp.draw(
Rectangle::new(Point::new(48, 16), Point::new(48 + 16, 16 + 16))
.stroke(Some(BinaryColor::On))
.into_iter(),
);
disp.draw(Circle::new(Point::new(96, 16 + 8), 8).into_iter()); disp.draw(
Circle::new(Point::new(96, 16 + 8), 8)
.stroke(Some(BinaryColor::On))
.into_iter(),
);
let local_addr = machine_ip::get().unwrap(); let local_addr = machine_ip::get().unwrap();