Готовая лаб.работа 1 (добавлены цвета)

This commit is contained in:
Данила Мочалов 2022-09-12 20:56:05 +04:00
commit 4f70dc343c

View File

@ -101,9 +101,9 @@ namespace Locomotive
//тело
g.DrawRectangle(pen, _startPosX , _startPosY, _locomotiveWidth - 10, _locomotiveHeight - 10);
//окна
g.FillRectangle(new SolidBrush(Locomotive?.BodyColor ?? Color.Black), _startPosX + 10, _startPosY + 10, 10, 10);
g.FillRectangle(new SolidBrush(Locomotive?.BodyColor ?? Color.Black), _startPosX + 30, _startPosY + 10, 10, 10);
g.FillRectangle(new SolidBrush(Locomotive?.BodyColor ?? Color.Black), _startPosX + 80, _startPosY + 10, 10, 10);
g.DrawRectangle(pen, _startPosX + 10, _startPosY + 10, 10, 10);
g.DrawRectangle(pen, _startPosX + 30, _startPosY + 10, 10, 10);
g.DrawRectangle(pen, _startPosX + 80, _startPosY + 10, 10, 10);
//дверь
g.DrawRectangle(pen, _startPosX + 50, _startPosY + 10, 10, 20);
//колеса
@ -112,7 +112,7 @@ namespace Locomotive
g.DrawEllipse(pen, _startPosX + 70, _startPosY + 40, 10, 10);
g.DrawEllipse(pen, _startPosX + 90, _startPosY + 40, 10, 10);
//черный прямоугольник
g.FillRectangle(new SolidBrush(Locomotive?.BodyColor ?? Color.Black), _startPosX + 100, _startPosY + 10, 10, 30);
g.FillRectangle(new SolidBrush(Color.Black), _startPosX + 100, _startPosY + 10, 10, 30);
}
public void ChangeBorders(int width, int height)