diff --git a/Trolleybus/Trolleybus/DrawingTrolleybus.cs b/Trolleybus/Trolleybus/DrawingTrolleybus.cs index f1ac88b..5ba3a9d 100644 --- a/Trolleybus/Trolleybus/DrawingTrolleybus.cs +++ b/Trolleybus/Trolleybus/DrawingTrolleybus.cs @@ -110,7 +110,36 @@ namespace Trolleybus /// 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); } /// /// Смена границ формы отрисовки diff --git a/Trolleybus/Trolleybus/Form1.Designer.cs b/Trolleybus/Trolleybus/Form1.Designer.cs index 29311d9..753eeea 100644 --- a/Trolleybus/Trolleybus/Form1.Designer.cs +++ b/Trolleybus/Trolleybus/Form1.Designer.cs @@ -75,7 +75,7 @@ namespace Trolleybus // // 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.Size = new System.Drawing.Size(75, 23); this.buttonCreate.TabIndex = 2; @@ -86,41 +86,41 @@ namespace Trolleybus // button5 // 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.Size = new System.Drawing.Size(30, 30); this.button5.TabIndex = 6; - this.button5.Text = "button5"; this.button5.UseVisualStyleBackColor = true; // // button4 // - this.button4.Image = global::Trolleybus.Properties.Resources.right30; - this.button4.Location = new System.Drawing.Point(758, 395); + this.button4.BackgroundImage = global::Trolleybus.Properties.Resources.right30; + this.button4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.button4.Location = new System.Drawing.Point(765, 383); this.button4.Name = "button4"; this.button4.Size = new System.Drawing.Size(30, 30); this.button4.TabIndex = 5; - this.button4.Text = "button4"; this.button4.UseVisualStyleBackColor = true; // // button3 // 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.Size = new System.Drawing.Size(30, 30); this.button3.TabIndex = 4; - this.button3.Text = "button3"; this.button3.UseVisualStyleBackColor = true; // // button2 // - this.button2.Image = global::Trolleybus.Properties.Resources.down30; - this.button2.Location = new System.Drawing.Point(722, 395); + this.button2.BackgroundImage = global::Trolleybus.Properties.Resources.down30; + this.button2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; + this.button2.Location = new System.Drawing.Point(729, 383); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(30, 30); this.button2.TabIndex = 3; - this.button2.Text = "button2"; this.button2.UseVisualStyleBackColor = true; // // pictureBoxTrolleybus