Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void paintTriangle(HWND* hWnd, int sx, int sy)
- {
- PAINTSTRUCT ps;
- HDC hdc = BeginPaint(*hWnd, &ps);
- int width = sx;
- int height = sy;
- int stX = (width - height) / 2;
- int stY = height;
- int lbX = stX;
- int lbY = stY-50;
- int tX = stX+(height/2);
- int tY = stY-450;
- int rbX = stX+height;
- int rbY = stY-50;
- BeginPath(hdc);
- HBRUSH blue = CreateSolidBrush(RGB(0,0,255));
- HBRUSH black = CreateSolidBrush(RGB(0,0,0));
- SelectObject(hdc, blue);
- FillPath(hdc);
- EndPath(hdc);
- for( int i = 0; i < width/2; i += 10 )
- {
- MoveToEx(hdc, lbX+i, lbY, NULL);
- LineTo(hdc, tX, tY);
- MoveToEx(hdc, tX, tY, NULL);
- LineTo(hdc, rbX-i, rbY);
- MoveToEx(hdc, rbX-i, rbY, NULL);
- LineTo(hdc, lbX+i, lbY);
- }
- Ellipse(hdc, lbX+150, lbY-250, rbX-150, rbY-100);
- SelectObject(hdc, black);
- FillPath(hdc);
- Ellipse(hdc, lbX+300, lbY-235, rbX-300, rbY-125);
- EndPaint(*hWnd, &ps);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement