Advertisement
Guest User

Untitled

a guest
Nov 19th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.74 KB | None | 0 0
  1. SelectObject(hdc, CreateSolidBrush(RGB(255,255,0)));
  2.         x = sx/40;
  3.         y = sy/40;
  4.         Ellipse(hdc, x - sx/10, y - sx/10,  x + sx/10, y + sx/10);
  5.  
  6.         //Дорога
  7.         y = 3*sy/4;
  8.         SelectObject(hdc, CreateSolidBrush(RGB(79,79,79)));
  9.         Rectangle(hdc, 0, y, sx, sy);
  10.  
  11.         //Кузов
  12.         x = sx/6;
  13.         y = sy/2;
  14.         SelectObject(hdc, CreateSolidBrush(RGB(125, 125, 0)));
  15.         Rectangle(hdc, x, y, sx - x, 4*sy/5);
  16.         Rectangle(hdc, sx/3, sy/4, sx - sx/3, sy/2+1);
  17.  
  18.         //Стекла
  19.         SelectObject(hdc, CreateSolidBrush(RGB(96, 143, 252)));
  20.         Rectangle(hdc, sx/3 + sx/100, sy/4 + sy/50, sx/2 - sx/100 , sy/2 - sy/50);
  21.         Rectangle(hdc, sx/2 + sx/100, sy/4 + sy/50, 2*sx/3 - sx/100 , sy/2 - sy/50);
  22.  
  23.         //Покрышки и диски
  24.         x = x + sx/8;
  25.         y = 4*sy/5;
  26.         SelectObject(hdc, CreateSolidBrush(RGB(0,0,0)));
  27.         Ellipse(hdc, x - sx/20, y - sx/20, x + sx/20, y + sx/20);
  28.         SelectObject(hdc, CreateSolidBrush(RGB(181,181,181)));
  29.         Ellipse(hdc, x - sx/30, y - sx/30, x + sx/30, y + sx/30);
  30.  
  31.         x = sx - x;
  32.         SelectObject(hdc, CreateSolidBrush(RGB(0,0,0)));
  33.         Ellipse(hdc, x - sx/20, y - sx/20, x + sx/20, y + sx/20);
  34.         SelectObject(hdc, CreateSolidBrush(RGB(181,181,181)));
  35.         Ellipse(hdc, x - sx/30, y - sx/30, x + sx/30, y + sx/30);
  36.  
  37.         //Фары
  38.         x = 5*sx/6;
  39.         y = 9*sy/16;
  40.         SelectObject(hdc, CreateSolidBrush(RGB(255,255,0)));
  41.         Rectangle(hdc, x - sx/20, y, x, y + sy/20);
  42.        
  43.         x = sx/6;
  44.         SelectObject(hdc, CreateSolidBrush(RGB(250,130,0)));
  45.         Rectangle(hdc, x, y, x+sx/40, y + sy/20);
  46.  
  47.         //Разметка
  48.         y = 4*sy/5 + sy/6;
  49.         hpen1 = CreatePen(PS_DASH, sy/80, RGB(255, 255, 255));
  50.         SelectObject(hdc, hpen1);
  51.         MoveToEx(hdc, 0, y, NULL);
  52.         LineTo(hdc, sx, y);
  53.  
  54.         y = 4*sy/5 + sy/7;
  55.         MoveToEx(hdc, 0, y, NULL);
  56.         LineTo(hdc, sx, y);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement