зафиксировать всё

This commit is contained in:
Учебный 2023-11-12 17:13:14 +04:00
parent 2645b2aa47
commit b15bf7d2c0
2 changed files with 21 additions and 21 deletions

View File

@ -29,7 +29,7 @@
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormBoat));
pictureBox1 = new PictureBox();
pictureBoxBoat = new PictureBox();
button_bottom = new Button();
button_top = new Button();
button_right = new Button();
@ -39,18 +39,18 @@
buttonStep = new Button();
comboBoxStrategy = new ComboBox();
buttonSelectBoat_Click = new Button();
((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
((System.ComponentModel.ISupportInitialize)pictureBoxBoat).BeginInit();
SuspendLayout();
//
// pictureBox1
// pictureBoxBoat
//
pictureBox1.Dock = DockStyle.Fill;
pictureBox1.Location = new Point(0, 0);
pictureBox1.Name = "pictureBox1";
pictureBox1.Size = new Size(1178, 644);
pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
pictureBox1.TabIndex = 0;
pictureBox1.TabStop = false;
pictureBoxBoat.Dock = DockStyle.Fill;
pictureBoxBoat.Location = new Point(0, 0);
pictureBoxBoat.Name = "pictureBoxBoat";
pictureBoxBoat.Size = new Size(1178, 644);
pictureBoxBoat.SizeMode = PictureBoxSizeMode.AutoSize;
pictureBoxBoat.TabIndex = 0;
pictureBoxBoat.TabStop = false;
//
// button_bottom
//
@ -153,7 +153,7 @@
buttonSelectBoat_Click.TabIndex = 10;
buttonSelectBoat_Click.Text = "Выбранная лодка";
buttonSelectBoat_Click.UseVisualStyleBackColor = true;
buttonSelectBoat_Click.Click += this.buttonSelectBoat_Click_Click;
buttonSelectBoat_Click.Click += buttonSelectBoat_Click_Click;
//
// FormBoat
//
@ -169,17 +169,17 @@
Controls.Add(button_right);
Controls.Add(button_top);
Controls.Add(button_bottom);
Controls.Add(pictureBox1);
Controls.Add(pictureBoxBoat);
Name = "FormBoat";
Text = "Form1";
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
Text = "FormBoat";
((System.ComponentModel.ISupportInitialize)pictureBoxBoat).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private PictureBox pictureBox1;
private PictureBox pictureBoxBoat;
private Button button_bottom;
private Button button_top;
private Button button_right;

View File

@ -37,11 +37,11 @@ namespace ProjectBoat_bae
{
return;
}
Bitmap bmp = new(pictureBox1.Width,
pictureBox1.Height);
Bitmap bmp = new(pictureBoxBoat.Width,
pictureBoxBoat.Height);
Graphics gr = Graphics.FromImage(bmp);
_drawingBoat.DrawTransport(gr);
pictureBox1.Image = bmp;
pictureBoxBoat.Image = bmp;
}
// Èçìåíåíèå ðàçìåðîâ ôîðìû
@ -90,7 +90,7 @@ namespace ProjectBoat_bae
_drawingBoat = new DrawningMotorBoat(random.Next(100, 300),
random.Next(1000, 3000), color, dopColor, Convert.ToBoolean(random.Next(0, 2)),
Convert.ToBoolean(random.Next(0, 2)),
pictureBox1.Width, pictureBox1.Height);
pictureBoxBoat.Width, pictureBoxBoat.Height);
_drawingBoat.SetPosition(random.Next(10, 100), random.Next(10, 100));
Draw();
}
@ -103,7 +103,7 @@ namespace ProjectBoat_bae
{
color = dialog.Color;
}
_drawingBoat = new Drawningboat(random.Next(100, 300), random.Next(1000, 3000), color, pictureBox1.Width, pictureBox1.Height);
_drawingBoat = new Drawningboat(random.Next(100, 300), random.Next(1000, 3000), color, pictureBoxBoat.Width, pictureBoxBoat.Height);
_drawingBoat.SetPosition(random.Next(10, 100), random.Next(10, 100));
Draw();
}
@ -127,7 +127,7 @@ namespace ProjectBoat_bae
{
return;
}
_abstractStrategy.SetData(new DrawningObjectBoat(_drawingBoat), pictureBox1.Width, pictureBox1.Height);
_abstractStrategy.SetData(new DrawningObjectBoat(_drawingBoat), pictureBoxBoat.Width, pictureBoxBoat.Height);
comboBoxStrategy.Enabled = false;
}
if (_abstractStrategy == null)