Доделан DrawBackground

This commit is contained in:
Сергей Полевой 2022-10-03 00:55:54 +04:00
parent 5ffa496f6f
commit 66371369da

View File

@ -97,15 +97,21 @@ namespace Artilleries
private void DrawBackground(Graphics g) private void DrawBackground(Graphics g)
{ {
Pen pen = new(Color.Black, 3); Pen pen = new(Color.Black, 3);
Brush boxBrush = new SolidBrush(Color.DarkGreen);
Pen thinPen = new Pen(Color.Black, 2);
Brush flagBrush = new SolidBrush(Color.Red);
for (int i = 0; i < _pictureWidth / _placeSizeWidth; i++) for (int i = 0; i < _pictureWidth / _placeSizeWidth; i++)
{ {
for (int j = 0; j < _pictureHeight / _placeSizeHeight + 1; ++j) for (int j = 0; j < _pictureHeight / _placeSizeHeight + 1; ++j)
{// TODO {
g.DrawLine(pen, i * _placeSizeWidth, j * _placeSizeHeight, i * g.DrawLine(pen, i * _placeSizeWidth, j * _placeSizeHeight, i * _placeSizeWidth + _placeSizeWidth / 2, j * _placeSizeHeight);
_placeSizeWidth + _placeSizeWidth / 2, j * _placeSizeHeight); g.FillRectangle(boxBrush, i * _placeSizeWidth + 5, j * _placeSizeHeight + _placeSizeHeight * 3 / 4 - 5, _placeSizeWidth / 3 - 5, _placeSizeHeight / 3 - 5);
g.DrawLine(thinPen, i * _placeSizeWidth + 5, j * _placeSizeHeight + _placeSizeHeight * 3 / 4 - 5, i * _placeSizeWidth + _placeSizeWidth / 3, j * _placeSizeHeight + _placeSizeHeight * 3 / 4 + _placeSizeHeight / 3 - 10);
g.DrawLine(thinPen, i * _placeSizeWidth + 5, j * _placeSizeHeight + _placeSizeHeight * 3 / 4 + _placeSizeHeight / 3 - 10, i * _placeSizeWidth + _placeSizeWidth / 3, j * _placeSizeHeight + _placeSizeHeight * 3 / 4 - 5);
g.FillRectangle(flagBrush, i * _placeSizeWidth + _placeSizeWidth * 5 / 12, j * _placeSizeHeight + _placeSizeHeight * 5 / 8 - 5, _placeSizeWidth / 5, _placeSizeHeight / 5);
g.DrawLine(thinPen, i * _placeSizeWidth + _placeSizeWidth * 5 / 12, j * _placeSizeHeight + _placeSizeHeight - 5, i * _placeSizeWidth + _placeSizeWidth * 5 / 12, j * _placeSizeHeight + _placeSizeHeight * 5 / 8 - 5);
} }
g.DrawLine(pen, i * _placeSizeWidth, 0, i * _placeSizeWidth, g.DrawLine(pen, i * _placeSizeWidth, 0, i * _placeSizeWidth, (_pictureHeight / _placeSizeHeight) * _placeSizeHeight);
(_pictureHeight / _placeSizeHeight) * _placeSizeHeight);
} }
} }