Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PAINTSTRUCT ps;
- HBRUSH hBrush = CreateSolidBrush(RGB(0,0,255));; //Цвет фона звезды
- HDC hdc = BeginPaint(*hWnd, &ps);
- HPEN hpen = CreatePen(PS_SOLID, 2, RGB(0,0,0)); //Цвет линий
- const int WIDTH = 400;
- const int HEIGHT = 300;
- POINT pt[5] = {
- {0, -100},
- {59, 95},
- {-95, -31},
- {95, -31},
- {-59, 95}
- };
- SetMapMode(hdc, MM_ANISOTROPIC);
- SetWindowExtEx(hdc, WIDTH, -HEIGHT, NULL);
- SetViewportExtEx(hdc, sx/2, sy/2, NULL);
- SetViewportOrgEx(hdc, sx/2, sy/2, NULL);
- hBrush = CreateSolidBrush(RGB(255, 255-255./2, 255-255./2));
- SelectObject(hdc, hBrush);
- BeginPath(hdc);
- Polygon(hdc, pt, 5);
- CloseFigure(hdc);
- EndPath(hdc);
- SelectObject(hdc, hBrush);
- SetPolyFillMode(hdc, WINDING);
- FillPath(hdc);
- EndPaint(*hWnd, &ps);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement