intermediate 1

This commit is contained in:
Oleg 2022-09-17 18:06:08 +04:00
parent 9b81076047
commit 717fbc3ca5
2 changed files with 41 additions and 12 deletions

View File

@ -110,7 +110,36 @@ namespace Trolleybus
/// <param name="g"></param> /// <param name="g"></param>
public void DrawTransport(Graphics g) public void DrawTransport(Graphics g)
{ {
if (_startPosX < 0 || _startPosY < 0
|| !_pictureHeight.HasValue || !_pictureWidth.HasValue)
{
return;
}
Pen pen = new Pen(Color.Black);
Brush brBlue = new SolidBrush(Color.LightBlue);
Brush dBlue = new SolidBrush(Color.DarkBlue);
Brush bWhite = new SolidBrush(Color.White);
g.DrawRectangle(pen, _startPosX, _startPosY, 200, 50);
g.DrawRectangle(pen, _startPosX + 100, _startPosY + 10, 20, 40);
Pen WinBlue = new Pen(Color.Blue);
g.FillEllipse(brBlue, _startPosX, _startPosY + 5, 20, 25);
g.DrawEllipse(WinBlue, _startPosX, _startPosY + 5, 20, 25);
g.FillEllipse(brBlue, _startPosX + 25, _startPosY + 5, 20, 25);
g.DrawEllipse(WinBlue, _startPosX + 25, _startPosY + 5, 20, 25);
g.FillEllipse(brBlue, _startPosX + 50, _startPosY + 5, 20, 25);
g.DrawEllipse(WinBlue, _startPosX + 50, _startPosY + 5, 20, 25);
g.FillEllipse(brBlue, _startPosX + 75, _startPosY + 5, 20, 25);
g.DrawEllipse(WinBlue, _startPosX + 75, _startPosY + 5, 20, 25);
g.FillEllipse(brBlue, _startPosX + 120, _startPosY + 5, 20, 25);
g.DrawEllipse(WinBlue, _startPosX + 120, _startPosY + 5, 20, 25);
g.FillEllipse(brBlue, _startPosX + 145, _startPosY + 5, 20, 25);
g.DrawEllipse(WinBlue, _startPosX + 145, _startPosY + 5, 20, 25);
g.FillEllipse(brBlue, _startPosX + 170, _startPosY + 5, 20, 25);
g.DrawEllipse(WinBlue, _startPosX + 170, _startPosY + 5, 20, 25);
g.FillEllipse(bWhite, _startPosX, _startPosY + 40, 30, 30);
g.DrawEllipse(pen, _startPosX, _startPosY + 40, 30, 30);
g.FillEllipse(bWhite, _startPosX + 170, _startPosY + 40, 30, 30);
g.DrawEllipse(pen, _startPosX + 170, _startPosY + 40, 30, 30);
} }
/// <summary> /// <summary>
/// Смена границ формы отрисовки /// Смена границ формы отрисовки

View File

@ -75,7 +75,7 @@ namespace Trolleybus
// //
// buttonCreate // buttonCreate
// //
this.buttonCreate.Location = new System.Drawing.Point(12, 395); this.buttonCreate.Location = new System.Drawing.Point(12, 390);
this.buttonCreate.Name = "buttonCreate"; this.buttonCreate.Name = "buttonCreate";
this.buttonCreate.Size = new System.Drawing.Size(75, 23); this.buttonCreate.Size = new System.Drawing.Size(75, 23);
this.buttonCreate.TabIndex = 2; this.buttonCreate.TabIndex = 2;
@ -86,41 +86,41 @@ namespace Trolleybus
// button5 // button5
// //
this.button5.BackgroundImage = global::Trolleybus.Properties.Resources.up30; this.button5.BackgroundImage = global::Trolleybus.Properties.Resources.up30;
this.button5.Location = new System.Drawing.Point(722, 359); this.button5.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.button5.Location = new System.Drawing.Point(729, 347);
this.button5.Name = "button5"; this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(30, 30); this.button5.Size = new System.Drawing.Size(30, 30);
this.button5.TabIndex = 6; this.button5.TabIndex = 6;
this.button5.Text = "button5";
this.button5.UseVisualStyleBackColor = true; this.button5.UseVisualStyleBackColor = true;
// //
// button4 // button4
// //
this.button4.Image = global::Trolleybus.Properties.Resources.right30; this.button4.BackgroundImage = global::Trolleybus.Properties.Resources.right30;
this.button4.Location = new System.Drawing.Point(758, 395); this.button4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.button4.Location = new System.Drawing.Point(765, 383);
this.button4.Name = "button4"; this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(30, 30); this.button4.Size = new System.Drawing.Size(30, 30);
this.button4.TabIndex = 5; this.button4.TabIndex = 5;
this.button4.Text = "button4";
this.button4.UseVisualStyleBackColor = true; this.button4.UseVisualStyleBackColor = true;
// //
// button3 // button3
// //
this.button3.BackgroundImage = global::Trolleybus.Properties.Resources.left30; this.button3.BackgroundImage = global::Trolleybus.Properties.Resources.left30;
this.button3.Location = new System.Drawing.Point(686, 395); this.button3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.button3.Location = new System.Drawing.Point(693, 383);
this.button3.Name = "button3"; this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(30, 30); this.button3.Size = new System.Drawing.Size(30, 30);
this.button3.TabIndex = 4; this.button3.TabIndex = 4;
this.button3.Text = "button3";
this.button3.UseVisualStyleBackColor = true; this.button3.UseVisualStyleBackColor = true;
// //
// button2 // button2
// //
this.button2.Image = global::Trolleybus.Properties.Resources.down30; this.button2.BackgroundImage = global::Trolleybus.Properties.Resources.down30;
this.button2.Location = new System.Drawing.Point(722, 395); this.button2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.button2.Location = new System.Drawing.Point(729, 383);
this.button2.Name = "button2"; this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(30, 30); this.button2.Size = new System.Drawing.Size(30, 30);
this.button2.TabIndex = 3; this.button2.TabIndex = 3;
this.button2.Text = "button2";
this.button2.UseVisualStyleBackColor = true; this.button2.UseVisualStyleBackColor = true;
// //
// pictureBoxTrolleybus // pictureBoxTrolleybus