#define STRICT #include #include #include #include HDC hdc; int MAXX, MAXY; void REFRESH() { ::ReleaseDC(0, hdc); hdc=::GetDC(0); } void PLOT(int x, int y) { ::SetPixelV(hdc, x, y, RGB(0, 0, 0)); } void LINE(int x, int y, int x2, int y2) { ::MoveToEx(hdc, x, y, NULL); ::LineTo(hdc, x2, y2); } void BEGIN() { hdc=::GetDC(0); MAXX=::GetDeviceCaps(hdc, HORZRES); MAXY=::GetDeviceCaps(hdc, VERTRES); ::Rectangle(hdc, 0, 0,MAXX, MAXY); } void END() { ::ReleaseDC(0, hdc); } int WINAPI WinMain(HINSTANCE hinst, HINSTANCE, LPSTR command, int showtype) { BEGIN(); int offx=20, offy=40; LINE(offx, 10, offx, MAXY-offy); LINE(offx, MAXY-offy, MAXX-10, MAXY-offy); for(int i=0; i<435; i++) { PLOT(offx+i, MAXY-offy-35*sin(double(i)/23.0)); REFRESH(); } END(); char ch; scanf("%c", &ch); return 0; }