-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetpixel1.cpp
27 lines (26 loc) · 891 Bytes
/
setpixel1.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <Windows.h>
#include <cmath>
int main() {
int y = GetSystemMetrics(SM_CYSCREEN);
int x = GetSystemMetrics(SM_CXSCREEN);
int yfull = GetSystemMetrics(SM_CYFULLSCREEN);
int xfull = GetSystemMetrics(SM_CXFULLSCREEN);
int rainbow = x - rand() % x - (x / 150 - 112) % 149;
int inc = round(x / 100);
round(y / 1);
round(yfull / 100);
round(xfull / 10);
while (1) {
HDC hdc = GetDC(0);
for (int yp = 0; yp < y; ++yp) {
for (int xp = 0; xp < x; ++xp) {
int xa = inc * xp;
SetPixel(hdc, xp, yp, RGB(xa, xa, xa));
SetPixel(hdc, yp, rainbow, RGB(yfull, xa, xfull));
SetPixel(hdc, rainbow, rainbow, RGB(rainbow, rainbow, rainbow));
SetPixel(hdc, rainbow, yp, RGB(xfull, yfull, xfull));
}
}
ReleaseDC(0, hdc);
}
}