#include #include #define febr 800 // 796 BILDBREITE #define feho 600 // 576 BILDHOEHE //---------------------VARIABLEN------------------------------------- int i, c, d, e, f, xx, yy; double x[38], y[38], p[38], r[38], a[38], b[38], s[38], pi, xa, xf, ya, yf, w, v; //------------------------------------------------------------------- static int cxClient, cyClient ; HDC hdc ; LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ; int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { static TCHAR szAppName[] = TEXT ("DASSISSESS") ; HWND hwnd ; MSG msg ; WNDCLASS wndclass ; wndclass.style = CS_HREDRAW | CS_VREDRAW ; wndclass.lpfnWndProc = WndProc ; wndclass.cbClsExtra = 0 ; wndclass.cbWndExtra = 0 ; wndclass.hInstance = hInstance ; wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ; wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ; wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH) ; wndclass.lpszMenuName = NULL ; wndclass.lpszClassName = szAppName ; if (!RegisterClass (&wndclass)) { MessageBox (NULL, TEXT ("Program requires Windows NT!"), szAppName, MB_ICONERROR) ; return 0 ; } hwnd = CreateWindow (szAppName, TEXT ("DASSISSESS"), WS_OVERLAPPEDWINDOW, 0, 0, febr, feho, NULL, NULL, hInstance, NULL) ; ShowWindow (hwnd, SW_SHOWMAXIMIZED) ; UpdateWindow (hwnd) ; while (GetMessage (&msg, NULL, 0, 0)) { TranslateMessage (&msg) ; DispatchMessage (&msg) ; } return msg.wParam ; } //------------------------------------UNTERPROGRAMME----------------- // KEINE //------------------------------------------------------------------- LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { PAINTSTRUCT ps ; switch (message) { case WM_SIZE: cxClient = LOWORD (lParam) ; cyClient = HIWORD (lParam) ; return 0 ; case WM_PAINT: hdc = BeginPaint (hwnd, &ps) ; //----------------------------------------HAUPTPROGRAMM-------------- /* 37 mal 7 Schief-Ellipsen-Fragment-Daten X-Position; Y-Position; X-Radius ; Y-Radius : Anf-Winkel; End-Winkel; Steigung;*/ x[ 1]= 50; y[ 1]= 0; p[ 1]= 150; r[ 1]= 130; a[ 1]= 265; b[ 1]= 360; s[ 1]= 0.1; x[ 2]= 50; y[ 2]= 0; p[ 2]= 150; r[ 2]= 130; a[ 2]= 29; b[ 2]= 140; s[ 2]= 0.1; x[ 3]= 50; y[ 3]= 0; p[ 3]= 150; r[ 3]= 130; a[ 3]= 146; b[ 3]= 189; s[ 3]= 0.1; x[ 4]= 50; y[ 4]= 0; p[ 4]= 150; r[ 4]= 130; a[ 4]= 194; b[ 4]= 230; s[ 4]= 0.1; x[ 5]=-167; y[ 5]=-119; p[ 5]= 20; r[ 5]= 25; a[ 5]= 0; b[ 5]= 370; s[ 5]=-1.2; x[ 6]=-149; y[ 6]= -40; p[ 6]= 50; r[ 6]= 50; a[ 6]= 80; b[ 6]= 210; s[ 6]= 0.2; x[ 7]= -98; y[ 7]=-140; p[ 7]= 50; r[ 7]= 50; a[ 7]= 272; b[ 7]= 410; s[ 7]= 0.2; x[ 8]= -10; y[ 8]= -20; p[ 8]= 60; r[ 8]= 60; a[ 8]= 0; b[ 8]= 365; s[ 8]= 0.6; x[ 9]= -95; y[ 9]= 30; p[ 9]= 60; r[ 9]= 60; a[ 9]= 57; b[ 9]= 185; s[ 9]= 0.6; x[10]= -25; y[10]= -35; p[10]= 30; r[10]= 30; a[10]= 162; b[10]= 308; s[10]= 0.6; x[11]=-100; y[11]= 15; p[11]= 30; r[11]= 25; a[11]= 148; b[11]= 182; s[11]= 0.6; x[12]= 30; y[12]= 30; p[12]= 100; r[12]= 100; a[12]= 193; b[12]= 243; s[12]= 0; x[13]= -35; y[13]= 90; p[13]= 100; r[13]= 100; a[13]= 198; b[13]= 219; s[13]= 0; x[14]= 90; y[14]= 170; p[14]= 50; r[14]= 70; a[14]= 205; b[14]= 515; s[14]= 0; x[15]= 45; y[15]= 85; p[15]= 30; r[15]= 33; a[15]= 35; b[15]= 165; s[15]= 0; x[16]= 135; y[16]= 85; p[16]= 30; r[16]= 33; a[16]= 195; b[16]= 325; s[16]= 0; x[17]= 90; y[17]= -30; p[17]= 90; r[17]= 90; a[17]= 335; b[17]= 385; s[17]= 0; x[18]= 20; y[18]= 210; p[18]= 50; r[18]= 70; a[18]= 205; b[18]= 435; s[18]= 0; x[19]= -25; y[19]= 125; p[19]= 30; r[19]= 33; a[19]= 35; b[19]= 105; s[19]= 0; x[20]= 65; y[20]= 125; p[20]= 30; r[20]= 33; a[20]= 270; b[20]= 315; s[20]= 0; x[21]= -27; y[21]=-135; p[21]= 40; r[21]= 40; a[21]= 35; b[21]= 145; s[21]= 0; x[22]= 67; y[22]=-135; p[22]= 40; r[22]= 40; a[22]= 215; b[22]= 325; s[22]= 0; x[23]= 20; y[23]=-180; p[23]= 10; r[23]= 10; a[23]= 70; b[23]= 290; s[23]= 0; x[24]= 3; y[24]=-174; p[24]= 10; r[24]= 10; a[24]= 100; b[24]= 320; s[24]= 0; x[25]= 37; y[25]=-174; p[25]= 10; r[25]= 10; a[25]= 40; b[25]= 260; s[25]= 0; x[26]= 20; y[26]= -76; p[26]= 35; r[26]= 35; a[26]= 140; b[26]= 220; s[26]= 0; x[27]= 93; y[27]= -95; p[27]= 40; r[27]= 40; a[27]= 35; b[27]= 145; s[27]= 0; x[28]= 187; y[28]= -95; p[28]= 40; r[28]= 40; a[28]= 215; b[28]= 325; s[28]= 0; x[29]= 140; y[29]=-140; p[29]= 10; r[29]= 10; a[29]= 70; b[29]= 290; s[29]= 0; x[30]= 123; y[30]=-134; p[30]= 10; r[30]= 10; a[30]= 100; b[30]= 320; s[30]= 0; x[31]= 157; y[31]=-134; p[31]= 10; r[31]= 10; a[31]= 40; b[31]= 260; s[31]= 0; x[32]= 140; y[32]= -36; p[32]= 35; r[32]= 35; a[32]= 140; b[32]= 220; s[32]= 0; x[33]= -97; y[33]= -95; p[33]= 40; r[33]= 40; a[33]= 95; b[33]= 145; s[33]= 0; x[34]= -3; y[34]= -95; p[34]= 40; r[34]= 40; a[34]= 215; b[34]= 240; s[34]= 0; x[35]= -50; y[35]=-140; p[35]= 10; r[35]= 10; a[35]= 70; b[35]= 290; s[35]= 0; x[36]= -67; y[36]=-134; p[36]= 10; r[36]= 10; a[36]= 100; b[36]= 320; s[36]= 0; x[37]= -33; y[37]=-134; p[37]= 10; r[37]= 10; a[37]= 40; b[37]= 260; s[37]= 0; pi = atan( 1 ) / 45; // Grad zu rad Umrechnungsfaktor xa = 140 * 3 - 120; // X-Abstand ya = 114 * 2.8 + 20; // Y-Abstand xf = 0.6 * 3 * 0.8 ; // X-Faktor yf = 0.4 * 2.8 * 1.05; // Y-Faktor // ---------------------------------------- GRAUER HINTERGRUND SelectObject( hdc, CreateSolidBrush( RGB( 128, 128, 128 ) ) ); FloodFill( hdc, int( 10), int( 10), RGB(0,0,0) ); // ---------------------------- 37 Muffel-Kontur-Linien schwarz SelectObject(hdc, CreatePen (PS_SOLID, 5, RGB( 0, 0, 0 ) ) ); for( i=1; i<38; i++ ) { // 37 Linien for( w=a[i]; w<=b[i]; w=w+( 57/(p[i]+r[i]) ) ) { // Winkel-Schritte v = w * pi; // Grad zu rad umrechnen xx=int(floor(0.5+xa-xf*(x[i]+p[i]*sin(v)))); // Muffel X und Y yy=int(floor(0.5+ya-yf*(y[i]+r[i]*cos(v))-s[i]*yf*p[i]*sin(v))); MoveToEx(hdc, xx, yy, NULL ); LineTo(hdc, xx, yy ); // Zeichnen } /* for next ( w ) */ } /* for next ( i ) */ // --------------------- 13 Farb-Punkte zum Starten der Paint-Routine SelectObject( hdc, CreateSolidBrush( RGB( 255, 0, 255 ) ) ); FloodFill( hdc, int(xa-xf* 90), int(ya-yf* 0), RGB(0,0,0) ); // 01 SelectObject( hdc, CreateSolidBrush( RGB( 0, 255, 0 ) ) ); FloodFill( hdc, int(xa-xf* -10), int(ya-yf* -20), RGB(0,0,0) ); // 02 SelectObject( hdc, CreateSolidBrush( RGB( 0, 255, 0 ) ) ); FloodFill( hdc, int(xa-xf* -70), int(ya-yf* 30), RGB(0,0,0) ); // 03 SelectObject( hdc, CreateSolidBrush( RGB( 255, 0, 0 ) ) ); FloodFill( hdc, int(xa-xf*-167), int(ya-yf*-119), RGB(0,0,0) ); // 04 SelectObject( hdc, CreateSolidBrush( RGB( 0, 255, 0 ) ) ); FloodFill( hdc, int(xa-xf* 90), int(ya-yf* 170), RGB(0,0,0) ); // 05 SelectObject( hdc, CreateSolidBrush( RGB( 0, 255, 0 ) ) ); FloodFill( hdc, int(xa-xf* 20), int(ya-yf* 210), RGB(0,0,0) ); // 06 SelectObject( hdc, CreateSolidBrush( RGB( 0, 255, 0 ) ) ); FloodFill( hdc, int(xa-xf* 20), int(ya-yf*-165), RGB(0,0,0) ); // 07 SelectObject( hdc, CreateSolidBrush( RGB( 0, 255, 0 ) ) ); FloodFill( hdc, int(xa-xf* 140), int(ya-yf*-125), RGB(0,0,0) ); // 08 SelectObject( hdc, CreateSolidBrush( RGB( 0, 255, 0 ) ) ); FloodFill( hdc, int(xa-xf* -50), int(ya-yf*-125), RGB(0,0,0) ); // 09 SelectObject( hdc, CreateSolidBrush( RGB( 0, 0, 255 ) ) ); FloodFill( hdc, int(xa-xf* -40), int(ya-yf* -55), RGB(0,0,0) ); // 10 SelectObject( hdc, CreateSolidBrush( RGB( 0, 0, 255 ) ) ); FloodFill( hdc, int(xa-xf* -94), int(ya-yf* 2), RGB(0,0,0) ); // 11 SelectObject( hdc, CreateSolidBrush( RGB( 255, 255, 0 ) ) ); FloodFill( hdc, int(xa-xf* -40), int(ya-yf* -80), RGB(0,0,0) ); // 12 SelectObject( hdc, CreateSolidBrush( RGB( 255, 255, 0 ) ) ); FloodFill( hdc, int(xa-xf* -90), int(ya-yf* -15), RGB(0,0,0) ); // 13 // ----------------------------------------- Kopieren und Verkleinern for( yy = int(576 * 0.5); yy > 0; yy = yy - 1 ) { // von unten for( xx = int(796 * 0.5); xx < 796; xx = xx + 1 ) { // von links c = GetPixel( hdc, ( xx - int(796 * 0.5) ) * 2, yy * 2 ); // Farbe if( c != RGB( 128, 128, 128 ) ) { SetPixel( hdc, xx, yy, c ); } } } //------------------------------------------------------------------- EndPaint (hwnd, &ps) ; return 0 ; case WM_DESTROY: PostQuitMessage (0) ; return 0 ; } return DefWindowProc (hwnd, message, wParam, lParam) ; }