#include #include #define febr 800 // 796 #define feho 600 // 576 //---------------------VARIABLEN------------------------------------- int i, c, d, e, f, xx, yy, ff; double x[44], y[44], p[44], r[44], a[44], b[44], s[44], pi, xa, xf, ya, yf, w, v, px, py, fx, fy, sc, aa, ab, ac, wa, wb, wc, rr, vv; //------------------------------------------------------------------- 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; // BLUME x[38]= 0; y[38]=-300; p[38]= 40; r[38]= 20; a[38]= 0; b[38]= 365; s[38]= 0; x[39]= -60; y[39]=-500; p[39]= 50; r[39]= 200; a[39]= 53; b[39]= 135; s[39]= 0; x[40]= 60; y[40]=-500; p[40]= 50; r[40]= 200; a[40]= 225; b[40]= 307; s[40]= 0; x[41]=-100; y[41]=-450; p[41]= 90; r[41]= 30; a[41]= 0; b[41]= 365; s[41]=-0.5; x[42]= 100; y[42]=-450; p[42]= 90; r[42]= 30; a[42]= 0; b[42]= 365; s[42]= 0.5; x[43]= 0; y[43]=-646; p[43]= 28; r[43]= 14; a[43]= 55; b[43]= 305; s[43]= 0; pi = atan( 1 ) / 45 ; // Grad zu rad Umrechnungsfaktor xa = 140 * 3 - 120 + 100 ; // X-Abstand ya = 114 * 2.8 + 20 - 170 ; // Y-Abstand xf = 0.6 * 3 * 0.8 * 0.5 ; // X-Faktor yf = 0.4 * 2.8 * 1.05 * 0.5 ; // Y-Faktor px = 140 * 3 - 120 + 100 ; // BLUETE py = 177 * 2.8 + 20 - 170 ; fx = 0.550 * 3 * 0.8 * 0.5 ; fy = -0.420 * 2.8 * 1.05 * 0.5 ; sc = 0.02; /* vv = xa; xa = ya; ya = vv; vv = xf; xf = yf; yf = vv; vv = px; px = py; py = vv; vv = fx; fx = fy; fy = vv; */ // GRAUER HINTERGRUND SelectObject( hdc, CreateSolidBrush( RGB( 128, 128, 128 ) ) ); FloodFill( hdc, int( 10), int( 10), RGB(0,0,0) ); //00 // 37 Muffel-Kontur-Linien // SelectObject( hdc, CreatePen (PS_SOLID, 2, RGB( 0, 0, 0 ) ) ); SelectObject( hdc, CreatePen( PS_SOLID, 3, RGB( 0, 0, 0 ) ) ); SelectObject( hdc, GetStockObject( NULL_BRUSH ) ); // SelectObject( hdc, CreateSolidBrush( RGB( 255, 255, 127 ) ) ); // Ellipse( hdc, 400 - 128, 300 - 128, 400 + 129, 300 + 129 ); for( i = 1; i < 44; i++ ) { // 37 + 6 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 u. 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 ); SetPixel( hdc, xx, yy, RGB( 0, 0, 0 ) ); } /* for ( w ) */ } /* for ( i ) */ // BLUETE for( wa = 0; wa < 361; wa = wa + ( 0.2 * sc ) ) { // Winkel-Schritte wb = wa * 10; aa = wa * pi; ab = wb * pi; wc = wa + 7 * sin(ab); ac = wc * pi; rr = 120 + 80 * cos(ab); // wc = wa + 0 * sin(ab); ac = wc * pi; // TEST A // rr = 40 + 1.5 * wa; // TEST B xx = int(floor( 0.5 + px + fx * cos(ac) * rr ) ); yy = int(floor( 0.5 + py + fy * sin(ac) * rr * 0.5 ) ); MoveToEx( hdc, xx, yy, NULL ); LineTo( hdc, xx, yy ); SetPixel( hdc, xx, yy, RGB( 0, 0, 0 ) ); } for( wa = 0; wa < 361; wa = wa + 36 ) { // Winkel-Schritte aa = wa * pi; rr = 120; xx = int(floor( 0.5 + px + fx * cos(aa) * rr ) ); yy = int(floor( 0.5 + py + fy * sin(aa) * rr * 0.5 ) ); ff = int(floor( 0.5 + wa * 2 / 3 ) ); SelectObject( hdc, CreatePen( PS_SOLID, 9, RGB( 255 - ff, 100, ff ) ) ); SelectObject( hdc, CreateSolidBrush( RGB( 255 - ff, 100, ff ) ) ); // MoveToEx( hdc, xx, yy, NULL ); // LineTo( hdc, xx, yy ); FloodFill( hdc, xx, yy, RGB( 0, 0, 0 ) ); } /* // 13 + 2 + 4 Farb-Punkte zum Starten der Paint-Routine SetPixel( hdc, int(xa-xf* 90),int(ya-yf* 0),0x00ff00ff);//01 SelectObject( hdc, CreatePen( PS_SOLID, 9, RGB( 255, 0, 255 ) ) ); MoveToEx( hdc, int(xa-xf* 90),int(ya-yf* 0), NULL ); LineTo( hdc, int(xa-xf* 90),int(ya-yf* 0) ); // BAUCH MoveToEx( hdc, int(xa-xf* 10),int(ya-yf* 80), NULL ); LineTo( hdc, int(xa-xf* 10),int(ya-yf* 80) ); // STIRN MoveToEx( hdc, int(xa-xf* -90),int(ya-yf* -60), NULL ); LineTo( hdc, int(xa-xf* -90),int(ya-yf* -60) ); // NASE SetPixel( hdc, int(xa-xf* -10),int(ya-yf* -20),0x0000ff00);//02 SelectObject( hdc, CreatePen( PS_SOLID, 9, RGB( 0, 255, 0 ) ) ); MoveToEx( hdc, int(xa-xf* -10),int(ya-yf* -20), NULL ); LineTo( hdc, int(xa-xf* -10),int(ya-yf* -20) ); SetPixel( hdc, int(xa-xf* -70),int(ya-yf* 30),0x0000ff00);//03 SelectObject( hdc, CreatePen( PS_SOLID, 9, RGB( 0, 255, 0 ) ) ); MoveToEx( hdc, int(xa-xf* -70),int(ya-yf* 30), NULL ); LineTo( hdc, int(xa-xf* -70),int(ya-yf* 30) ); SetPixel( hdc, int(xa-xf*-167),int(ya-yf*-119),0x000000ff);//04 SelectObject( hdc, CreatePen( PS_SOLID, 9, RGB( 255, 0, 0 ) ) ); MoveToEx( hdc, int(xa-xf*-167),int(ya-yf*-119), NULL ); LineTo( hdc, int(xa-xf*-167),int(ya-yf*-119) ); SetPixel( hdc, int(xa-xf* 90),int(ya-yf* 170),0x0000ff00);//05 SelectObject( hdc, CreatePen( PS_SOLID, 9, RGB( 0, 255, 0 ) ) ); MoveToEx( hdc, int(xa-xf* 90),int(ya-yf* 170), NULL ); LineTo( hdc, int(xa-xf* 90),int(ya-yf* 170) ); SetPixel( hdc, int(xa-xf* 20),int(ya-yf* 210),0x0000ff00);//06 SelectObject( hdc, CreatePen( PS_SOLID, 9, RGB( 0, 255, 0 ) ) ); MoveToEx( hdc, int(xa-xf* 20),int(ya-yf* 210), NULL ); LineTo( hdc, int(xa-xf* 20),int(ya-yf* 210) ); SetPixel( hdc, int(xa-xf* 20),int(ya-yf*-165),0x0000ff00);//07 SelectObject( hdc, CreatePen( PS_SOLID, 9, RGB( 0, 255, 0 ) ) ); MoveToEx( hdc, int(xa-xf* 20),int(ya-yf*-165), NULL ); LineTo( hdc, int(xa-xf* 20),int(ya-yf*-165) ); SetPixel( hdc, int(xa-xf* 140),int(ya-yf*-125),0x0000ff00);//08 SelectObject( hdc, CreatePen( PS_SOLID, 9, RGB( 0, 255, 0 ) ) ); MoveToEx( hdc, int(xa-xf* 140),int(ya-yf*-125), NULL ); LineTo( hdc, int(xa-xf* 140),int(ya-yf*-125) ); SetPixel( hdc, int(xa-xf* -50),int(ya-yf*-125),0x0000ff00);//09 SelectObject( hdc, CreatePen( PS_SOLID, 9, RGB( 0, 255, 0 ) ) ); MoveToEx( hdc, int(xa-xf* -50),int(ya-yf*-125), NULL ); LineTo( hdc, int(xa-xf* -50),int(ya-yf*-125) ); SetPixel( hdc, int(xa-xf* -40),int(ya-yf* -55),0x00ff0000);//10 SelectObject( hdc, CreatePen( PS_SOLID, 9, RGB( 0, 0, 255 ) ) ); MoveToEx( hdc, int(xa-xf* -40),int(ya-yf* -55), NULL ); LineTo( hdc, int(xa-xf* -40),int(ya-yf* -55) ); SetPixel( hdc, int(xa-xf* -94),int(ya-yf* 2),0x00ff0000);//11 SelectObject( hdc, CreatePen( PS_SOLID, 4, RGB( 0, 0, 255 ) ) ); MoveToEx( hdc, int(xa-xf* -94),int(ya-yf* 2), NULL ); LineTo( hdc, int(xa-xf* -94),int(ya-yf* 2) ); SetPixel( hdc, int(xa-xf* -40),int(ya-yf* -80),0x000000ff);//12 SelectObject( hdc, CreatePen( PS_SOLID, 9, RGB( 255, 255, 0 ) ) ); MoveToEx( hdc, int(xa-xf* -40),int(ya-yf* -80), NULL ); LineTo( hdc, int(xa-xf* -40),int(ya-yf* -80) ); SetPixel( hdc, int(xa-xf* -90),int(ya-yf* -15),0x000000ff);//13 SelectObject( hdc, CreatePen( PS_SOLID, 9, RGB( 255, 255, 0 ) ) ); MoveToEx( hdc, int(xa-xf* -90),int(ya-yf* -15), NULL ); LineTo( hdc, int(xa-xf* -90),int(ya-yf* -15) ); // BLUME SelectObject( hdc, CreatePen( PS_SOLID, 9, RGB( 255, 255, 0 ) ) ); MoveToEx( hdc, int(xa ),int(ya-yf*-300), NULL ); LineTo( hdc, int(xa ),int(ya-yf*-300) ); SelectObject( hdc, CreatePen( PS_SOLID, 9, RGB( 0, 255, 0 ) ) ); MoveToEx( hdc, int(xa-xf*-100),int(ya-yf*-450), NULL ); LineTo( hdc, int(xa-xf*-100),int(ya-yf*-450) ); SelectObject( hdc, CreatePen( PS_SOLID, 9, RGB( 0, 255, 0 ) ) ); MoveToEx( hdc, int(xa-xf* 100),int(ya-yf*-450), NULL ); LineTo( hdc, int(xa-xf* 100),int(ya-yf*-450) ); SelectObject( hdc, CreatePen( PS_SOLID, 9, RGB( 0, 255, 0 ) ) ); MoveToEx( hdc, int(xa ),int(ya-yf*-450), NULL ); LineTo( hdc, int(xa ),int(ya-yf*-450) ); */ // 13 + 2 + 4 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) ); //01A FloodFill( hdc, int(xa-xf* 10), int(ya-yf* 80), RGB(0,0,0) ); //01B FloodFill( hdc, int(xa-xf* -90), int(ya-yf* -60), RGB(0,0,0) ); //01C 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, 127, 255 ) ) ); FloodFill( hdc, int(xa-xf* -40), int(ya-yf* -55), RGB(0,0,0) ); //10 SelectObject( hdc, CreateSolidBrush( RGB( 0, 127, 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 SelectObject( hdc, CreateSolidBrush( RGB( 255, 255, 0 ) ) ); FloodFill( hdc, int(xa ), int(ya-yf*-300), RGB(0,0,0) ); //14 SelectObject( hdc, CreateSolidBrush( RGB( 0, 255, 0 ) ) ); FloodFill( hdc, int(xa-xf*-100), int(ya-yf*-450), RGB(0,0,0) ); //15 FloodFill( hdc, int(xa-xf* 100), int(ya-yf*-450), RGB(0,0,0) ); //16 FloodFill( hdc, int(xa ), int(ya-yf*-450), RGB(0,0,0) ); //17 // Kopieren und Verkleinern /* for( yy = int(576 * 0.5); yy > 0; yy = yy - 1 ) { for( xx = int(796 * 0.5); xx < 796; xx = xx + 1 ) { c = GetPixel( hdc, ( xx - int(796 * 0.5) ) * 2, yy * 2 ); if( c != RGB( 128, 128, 128 ) ) { SetPixel( hdc, xx, yy, c ); } } } */ // Test-Rahmen /* SelectObject(hdc, CreatePen (PS_SOLID, 3, RGB( 255, 0, 0 ) ) ); MoveToEx(hdc, 0, 0, NULL ); LineTo(hdc, 575, 0 ); LineTo(hdc, 575, 575 ); LineTo(hdc, 0, 575 ); LineTo(hdc, 0, 0 ); MoveToEx(hdc, 0, 0, NULL ); LineTo(hdc, 795, 0 ); LineTo(hdc, 795, 575 ); LineTo(hdc, 0, 575 ); LineTo(hdc, 0, 0 ); */ //------------------------------------------------------------------- EndPaint (hwnd, &ps) ; return 0 ; case WM_DESTROY: PostQuitMessage (0) ; return 0 ; } return DefWindowProc (hwnd, message, wParam, lParam) ; }