Advertisement
Guest User

KGLab1

a guest
May 25th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void paintTriangle(HWND* hWnd, int sx, int sy)
  2. {
  3.     PAINTSTRUCT ps;
  4.     HDC hdc = BeginPaint(*hWnd, &ps);
  5.  
  6.     int width = sx;
  7.     int height = sy;
  8.     int stX = (width - height) / 2;
  9.     int stY = height;
  10.  
  11.     int lbX = stX;
  12.     int lbY = stY-50;
  13.  
  14.     int tX = stX+(height/2);
  15.     int tY = stY-450;
  16.  
  17.     int rbX = stX+height;
  18.     int rbY = stY-50;
  19.  
  20.  
  21.     BeginPath(hdc);
  22.     HBRUSH blue = CreateSolidBrush(RGB(0,0,255));
  23.     HBRUSH black = CreateSolidBrush(RGB(0,0,0));
  24.     SelectObject(hdc, blue);
  25.     FillPath(hdc);
  26.     EndPath(hdc);
  27.  
  28.  
  29.     for( int i = 0; i < width/2; i += 10 )
  30.     {
  31.         MoveToEx(hdc, lbX+i, lbY, NULL);
  32.         LineTo(hdc, tX, tY);
  33.  
  34.         MoveToEx(hdc, tX, tY, NULL);
  35.         LineTo(hdc, rbX-i, rbY);
  36.  
  37.         MoveToEx(hdc, rbX-i, rbY, NULL);
  38.         LineTo(hdc, lbX+i, lbY);
  39.     }
  40.     Ellipse(hdc, lbX+150, lbY-250, rbX-150, rbY-100);
  41.  
  42.     SelectObject(hdc, black);
  43.     FillPath(hdc);
  44.     Ellipse(hdc, lbX+300, lbY-235, rbX-300, rbY-125);
  45.  
  46.     EndPaint(*hWnd, &ps);
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement