Advertisement
honey_the_codewitch

line drawing

Mar 26th, 2022
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. for(int i = 1;i<100;i+=2) {
  2.     // calculate our extents
  3.     srect16 r(i*(lcd.dimensions().width/100.0),
  4.             i*(lcd.dimensions().height/100.0),
  5.             lcd.dimensions().width-i*(lcd.dimensions().width/100.0)-1,
  6.             lcd.dimensions().height-i*(lcd.dimensions().height/100.0)-1);
  7.     // draw the four lines
  8.     draw::line(lcd,srect16(0,r.y1,r.x1,lcd.dimensions().height-1),lcd_color::light_blue);
  9.     draw::line(lcd,srect16(r.x2,0,lcd.dimensions().width-1,r.y2),lcd_color::hot_pink);
  10.     draw::line(lcd,srect16(0,r.y2,r.x1,0),lcd_color::pale_green);
  11.     draw::line(lcd,srect16(lcd.dimensions().width-1,r.y1,r.x2,lcd.dimensions().height-1),lcd_color::yellow);
  12.    
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement