Skip to content

Commit f61b5a5

Browse files
committed
window management
1 parent 82620b7 commit f61b5a5

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

example/demo1.cpp

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,38 @@ bool demoSineWave(int frameCount, long long start, Image image) {
120120
return ((now - start) < 8000);
121121
}
122122

123+
void rotationDemo() {
124+
125+
d1.clearScreen(DARK_BLUE);
126+
int tmpWidth = 100;
127+
int tmpHeight = 51;
128+
129+
Image tmpimg = Image(tmpWidth, tmpHeight, BLACK);
130+
131+
tmpimg.drawLine(00, 00, 99, 00, WHITE, SOLID, 1); // top
132+
tmpimg.drawLine(00, 00, 00, 50, WHITE, SOLID, 1); // left
133+
tmpimg.drawLine(99, 00, 99, 50, WHITE, SOLID, 1); // right
134+
tmpimg.drawLine(00, 50, 99, 50, WHITE, SOLID, 1); // bottom
135+
136+
printf("--- DEGREE_0 --------------------------------------------------\n");
137+
tmpimg.drawText(10, 10, "D_0", &Font24, BLACK, RED);
138+
d1.showImage(tmpimg, Point(30, 10), Point(30 + tmpWidth - 1, 10 + tmpHeight - 1), DEGREE_0); // RED
139+
140+
printf("--- DEGREE_180 --------------------------------------------------\n");
141+
tmpimg.drawText(10, 10, "D_180", &Font24, BLACK, GREEN);
142+
d1.showImage(tmpimg, Point(30, 10), Point(30 + tmpWidth - 1, 10 + tmpHeight - 1), DEGREE_180); // GREEN
143+
144+
printf("--- DEGREE_90 --------------------------------------------------\n");
145+
tmpimg.drawText(10, 10, "D_90", &Font24, BLACK, YELLOW);
146+
d1.showImage(tmpimg, Point(30, 10), Point(30 + tmpWidth - 1, 10 + tmpHeight - 1), DEGREE_90); // YELLOW
147+
148+
printf("--- DEGREE_270 --------------------------------------------------\n");
149+
tmpimg.drawText(10, 10, "D_270", &Font24, BLACK, CYAN);
150+
d1.showImage(tmpimg, Point(30, 10), Point(30 + tmpWidth - 1, 10 + tmpHeight - 1), DEGREE_270); // CYAN
151+
152+
153+
}
154+
123155
void display1Demo() {
124156
printf("demo1\n"); fflush(stdout);
125157

@@ -143,8 +175,10 @@ void display1Demo() {
143175
d1.clearScreen(BLACK);
144176

145177
d1.showImage(bmp, DEGREE_270);
178+
delay(2000);
146179

147-
delay(1000);
180+
rotationDemo();
181+
delay(4000);
148182

149183
long long start = currentTimeMillis();
150184

0 commit comments

Comments
 (0)