Advertisement
Guest User

KGLab34

a guest
May 25th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. PAINTSTRUCT ps;
  2. HBRUSH hBrush = CreateSolidBrush(RGB(0,0,255));; //Цвет фона звезды
  3. HDC hdc = BeginPaint(*hWnd, &ps);
  4. HPEN hpen = CreatePen(PS_SOLID, 2, RGB(0,0,0)); //Цвет линий
  5.  
  6. const int WIDTH = 400;
  7. const int HEIGHT = 300;
  8.    
  9. POINT pt[5] = {
  10.     {0, -100},
  11.     {59, 95},
  12.     {-95, -31},
  13.     {95, -31},
  14.     {-59, 95}
  15. };
  16.  
  17. SetMapMode(hdc, MM_ANISOTROPIC);
  18. SetWindowExtEx(hdc, WIDTH, -HEIGHT, NULL);
  19. SetViewportExtEx(hdc, sx/2, sy/2, NULL);
  20. SetViewportOrgEx(hdc, sx/2, sy/2, NULL);
  21.    
  22. hBrush = CreateSolidBrush(RGB(255, 255-255./2, 255-255./2));
  23.        
  24. SelectObject(hdc, hBrush);
  25.  
  26. BeginPath(hdc);
  27.  
  28. Polygon(hdc, pt, 5);
  29.  
  30. CloseFigure(hdc);
  31. EndPath(hdc);
  32. SelectObject(hdc, hBrush);
  33. SetPolyFillMode(hdc, WINDING);
  34. FillPath(hdc);
  35.  
  36. EndPaint(*hWnd, &ps);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement