Замена автомобиля на самолет

This commit is contained in:
Данияр Аглиуллов 2022-09-29 21:55:54 +04:00
parent 2f87fa46bd
commit 97fda24a73
2 changed files with 18 additions and 18 deletions

View File

@ -28,7 +28,7 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.pictureBoxCar = new System.Windows.Forms.PictureBox(); this.pictureBoxAirplane = new System.Windows.Forms.PictureBox();
this.statusStrip = new System.Windows.Forms.StatusStrip(); this.statusStrip = new System.Windows.Forms.StatusStrip();
this.toolStripStatusLabelSpeed = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabelSpeed = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabelWeight = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabelWeight = new System.Windows.Forms.ToolStripStatusLabel();
@ -43,16 +43,16 @@
this.statusStrip.SuspendLayout(); this.statusStrip.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// pictureBoxCar // pictureBoxAirplane
// //
this.pictureBoxCar.Dock = System.Windows.Forms.DockStyle.Fill; this.pictureBoxAirplane.Dock = System.Windows.Forms.DockStyle.Fill;
this.pictureBoxCar.Location = new System.Drawing.Point(0, 0); this.pictureBoxAirplane.Location = new System.Drawing.Point(0, 0);
this.pictureBoxCar.Name = "pictureBoxCar"; this.pictureBoxAirplane.Name = "pictureBoxAirplane";
this.pictureBoxCar.Size = new System.Drawing.Size(800, 428); this.pictureBoxAirplane.Size = new System.Drawing.Size(800, 428);
this.pictureBoxCar.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.pictureBoxAirplane.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.pictureBoxCar.TabIndex = 0; this.pictureBoxAirplane.TabIndex = 0;
this.pictureBoxCar.TabStop = false; this.pictureBoxAirplane.TabStop = false;
this.pictureBoxCar.Resize += new System.EventHandler(this.PictureBoxCar_Resize); this.pictureBoxAirplane.Resize += new System.EventHandler(this.PictureBoxAirplane_Resize);
// //
// statusStrip // statusStrip
// //
@ -164,11 +164,11 @@
this.Controls.Add(this.buttonLeft); this.Controls.Add(this.buttonLeft);
this.Controls.Add(this.buttonUp); this.Controls.Add(this.buttonUp);
this.Controls.Add(this.buttonCreate); this.Controls.Add(this.buttonCreate);
this.Controls.Add(this.pictureBoxCar); this.Controls.Add(this.pictureBoxAirplane);
this.Controls.Add(this.statusStrip); this.Controls.Add(this.statusStrip);
this.Name = "FormAirBomber"; this.Name = "FormAirBomber";
this.Text = "Самолет"; this.Text = "Самолет";
((System.ComponentModel.ISupportInitialize)(this.pictureBoxCar)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxAirplane)).EndInit();
this.statusStrip.ResumeLayout(false); this.statusStrip.ResumeLayout(false);
this.statusStrip.PerformLayout(); this.statusStrip.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
@ -178,7 +178,7 @@
#endregion #endregion
private PictureBox pictureBoxCar; private PictureBox pictureBoxAirplane;
private StatusStrip statusStrip; private StatusStrip statusStrip;
private ToolStripStatusLabel toolStripStatusLabelSpeed; private ToolStripStatusLabel toolStripStatusLabelSpeed;
private ToolStripStatusLabel toolStripStatusLabelWeight; private ToolStripStatusLabel toolStripStatusLabelWeight;

View File

@ -9,14 +9,14 @@ namespace AirBomber
InitializeComponent(); InitializeComponent();
} }
/// <summary> /// <summary>
/// Ìåòîä ïðîðèñîâêè ìàøèíû /// Ìåòîä ïğîğèñîâêè ñàìîëåòà
/// </summary> /// </summary>
private void Draw() private void Draw()
{ {
Bitmap bmp = new(pictureBoxCar.Width, pictureBoxCar.Height); Bitmap bmp = new(pictureBoxAirplane.Width, pictureBoxAirplane.Height);
Graphics gr = Graphics.FromImage(bmp); Graphics gr = Graphics.FromImage(bmp);
_airplane?.DrawTransport(gr); _airplane?.DrawTransport(gr);
pictureBoxCar.Image = bmp; pictureBoxAirplane.Image = bmp;
} }
/// <summary> /// <summary>
/// Ìåòîä óñòàíîâêè äàííûõ /// Ìåòîä óñòàíîâêè äàííûõ
@ -72,9 +72,9 @@ namespace AirBomber
/// </summary> /// </summary>
/// <param name="sender"></param> /// <param name="sender"></param>
/// <param name="e"></param> /// <param name="e"></param>
private void PictureBoxCar_Resize(object sender, EventArgs e) private void PictureBoxAirplane_Resize(object sender, EventArgs e)
{ {
_airplane?.ChangeBorders(pictureBoxCar.Width, pictureBoxCar.Height); _airplane?.ChangeBorders(pictureBoxAirplane.Width, pictureBoxAirplane.Height);
Draw(); Draw();
} }
/// <summary> /// <summary>