commit 2
This commit is contained in:
parent
c141ffc95e
commit
ff7a87438e
@ -30,7 +30,7 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ширина прорисовки тепловоза
|
/// Ширина прорисовки тепловоза
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private readonly int _drawningLocomotiveWidth = 110;
|
private readonly int _drawningLocomotiveWidth = 120;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Высота прорисовки тепловоза
|
/// Высота прорисовки тепловоза
|
||||||
@ -67,9 +67,21 @@
|
|||||||
///разместить объект в этих размерах</returns>
|
///разместить объект в этих размерах</returns>
|
||||||
public bool SetPictureSize(int width, int height)
|
public bool SetPictureSize(int width, int height)
|
||||||
{
|
{
|
||||||
_pictureWidth = width;
|
if (width > _drawningLocomotiveWidth || height > _drawningLocomotiveHeight) // если ширина и высота окна больше чем объект
|
||||||
_pictureHeight = height;
|
{
|
||||||
return true;
|
_pictureWidth = width;
|
||||||
|
_pictureHeight = height;
|
||||||
|
if (_startPosX + _drawningLocomotiveWidth > width || _startPosX < 0) // если координаты выходят за пределы, корректируем
|
||||||
|
{
|
||||||
|
_startPosX = 0;
|
||||||
|
}
|
||||||
|
if (_startPosY + _drawningLocomotiveHeight > height || _startPosY < 0)
|
||||||
|
{
|
||||||
|
_startPosY = 0;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Установка позиции
|
/// Установка позиции
|
||||||
@ -82,18 +94,27 @@
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (x < 0 || x + _drawningLocomotiveWidth > _pictureWidth || y < 0 || y + _drawningLocomotiveHeight > _pictureHeight)
|
|
||||||
{
|
// если все нормально
|
||||||
_startPosX = 20;
|
if (x > 0 || x + _drawningLocomotiveWidth < _pictureWidth)
|
||||||
_startPosY = 20;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
_startPosX = x;
|
_startPosX = x;
|
||||||
|
}
|
||||||
|
if (y > 0 || y + _drawningLocomotiveHeight < _pictureHeight)
|
||||||
|
{
|
||||||
_startPosY = y;
|
_startPosY = y;
|
||||||
}
|
}
|
||||||
|
// если не лезет, но мог бы влезть
|
||||||
|
if (x < 0 || x + _drawningLocomotiveWidth > _pictureWidth)
|
||||||
|
{
|
||||||
|
_startPosX = 0;
|
||||||
|
}
|
||||||
|
if (y < 0 || y + _drawningLocomotiveHeight > _pictureHeight)
|
||||||
|
{
|
||||||
|
_startPosY = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Изменение направления перемещения
|
/// Изменение направления перемещения
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -118,7 +139,7 @@
|
|||||||
return true;
|
return true;
|
||||||
//вверх
|
//вверх
|
||||||
case DirectionType.Up:
|
case DirectionType.Up:
|
||||||
if (_startPosY.Value - EntityLocomotive.Step > 0)
|
if (_startPosY.Value - EntityLocomotive.Step > 0) // 10 – высота трубы
|
||||||
{
|
{
|
||||||
_startPosY -= (int)EntityLocomotive.Step;
|
_startPosY -= (int)EntityLocomotive.Step;
|
||||||
}
|
}
|
||||||
@ -181,56 +202,56 @@
|
|||||||
Brush whiteBrush = new SolidBrush(Color.White);
|
Brush whiteBrush = new SolidBrush(Color.White);
|
||||||
//границы тепловоза
|
//границы тепловоза
|
||||||
DrawPolygon(g, pen, bodyBrush,
|
DrawPolygon(g, pen, bodyBrush,
|
||||||
_startPosX.Value, _startPosY.Value,
|
_startPosX.Value + 5, _startPosY.Value + 10,
|
||||||
_startPosX.Value + 100, _startPosY.Value,
|
_startPosX.Value + 105, _startPosY.Value + 10,
|
||||||
_startPosX.Value + 110, _startPosY.Value + 20,
|
_startPosX.Value + 115, _startPosY.Value + 20 + 10,
|
||||||
_startPosX.Value, _startPosY.Value + 20
|
_startPosX.Value + 5, _startPosY.Value + 20 + 10
|
||||||
);
|
);
|
||||||
g.FillRectangle(additionalBrush, _startPosX.Value, _startPosY.Value + 20, 110, 20);
|
g.FillRectangle(additionalBrush, _startPosX.Value + 5, _startPosY.Value + +10 + 20, 110, 20);
|
||||||
g.DrawRectangle(pen, _startPosX.Value, _startPosY.Value + 20, 110, 20);
|
g.DrawRectangle(pen, _startPosX.Value + 5, _startPosY.Value + 20 + 10, 110, 20);
|
||||||
g.FillRectangle(blackBrush, _startPosX.Value - 5, _startPosY.Value + 5, 5, 30);
|
g.FillRectangle(blackBrush, _startPosX.Value, _startPosY.Value + 5 + 10, 5, 30);
|
||||||
//шасси
|
//шасси
|
||||||
DrawPolygon(g, pen, blackBrush,
|
DrawPolygon(g, pen, blackBrush,
|
||||||
_startPosX.Value - 5, _startPosY.Value + 45,
|
_startPosX.Value, _startPosY.Value + 45 + 10,
|
||||||
_startPosX.Value + 5, _startPosY.Value + 40,
|
_startPosX.Value + 10, _startPosY.Value + 40 + 10,
|
||||||
_startPosX.Value + 45, _startPosY.Value + 40,
|
_startPosX.Value + 50, _startPosY.Value + 40 + 10,
|
||||||
_startPosX.Value + 45, _startPosY.Value + 45
|
_startPosX.Value + 50, _startPosY.Value + 45 + 10
|
||||||
);
|
);
|
||||||
DrawPolygon(g, pen, blackBrush,
|
DrawPolygon(g, pen, blackBrush,
|
||||||
_startPosX.Value + 65, _startPosY.Value + 40,
|
_startPosX.Value + 70, _startPosY.Value + 40 + 10,
|
||||||
_startPosX.Value + 105, _startPosY.Value + 40,
|
_startPosX.Value + 110, _startPosY.Value + 40 + 10,
|
||||||
_startPosX.Value + 115, _startPosY.Value + 45,
|
_startPosX.Value + 120, _startPosY.Value + 45 + 10,
|
||||||
_startPosX.Value + 65, _startPosY.Value + 45
|
_startPosX.Value + 70, _startPosY.Value + 45 + 10
|
||||||
);
|
);
|
||||||
//колеса
|
//колеса
|
||||||
g.DrawEllipse(pen, _startPosX.Value + 10, _startPosY.Value + 40, 10, 10);
|
g.DrawEllipse(pen, _startPosX.Value + 15, _startPosY.Value + 40 + 10, 10, 10);
|
||||||
g.FillEllipse(whiteBrush, _startPosX.Value + 10, _startPosY.Value + 40, 10, 10);
|
g.FillEllipse(whiteBrush, _startPosX.Value + 15, _startPosY.Value + 40 + 10, 10, 10);
|
||||||
g.DrawEllipse(pen, _startPosX.Value + 25, _startPosY.Value + 40, 10, 10);
|
g.DrawEllipse(pen, _startPosX.Value + 30, _startPosY.Value + 40 + 10, 10, 10);
|
||||||
g.FillEllipse(whiteBrush, _startPosX.Value + 25, _startPosY.Value + 40, 10, 10);
|
g.FillEllipse(whiteBrush, _startPosX.Value + 30, _startPosY.Value + 40 + 10, 10, 10);
|
||||||
g.DrawEllipse(pen, _startPosX.Value + 75, _startPosY.Value + 40, 10, 10);
|
g.DrawEllipse(pen, _startPosX.Value + 80, _startPosY.Value + 40 + 10, 10, 10);
|
||||||
g.FillEllipse(whiteBrush, _startPosX.Value + 75, _startPosY.Value + 40, 10, 10);
|
g.FillEllipse(whiteBrush, _startPosX.Value + 80, _startPosY.Value + 40 + 10, 10, 10);
|
||||||
g.DrawEllipse(pen, _startPosX.Value + 90, _startPosY.Value + 40, 10, 10);
|
g.DrawEllipse(pen, _startPosX.Value + 95, _startPosY.Value + 40 + 10, 10, 10);
|
||||||
g.FillEllipse(whiteBrush, _startPosX.Value + 90, _startPosY.Value + 40, 10, 10);
|
g.FillEllipse(whiteBrush, _startPosX.Value + 95, _startPosY.Value + 40 + 10, 10, 10);
|
||||||
//дверь
|
//дверь
|
||||||
g.FillRectangle(bodyBrush, _startPosX.Value + 50, _startPosY.Value + 10, 10, 20);
|
g.FillRectangle(bodyBrush, _startPosX.Value + 50, _startPosY.Value + 10 + 10, 10, 20);
|
||||||
g.DrawRectangle(pen, _startPosX.Value + 50, _startPosY.Value + 10, 10, 20);
|
g.DrawRectangle(pen, _startPosX.Value + 50, _startPosY.Value + 10 + 10, 10, 20);
|
||||||
//окна
|
//окна
|
||||||
pen = new(Color.Blue);
|
pen = new(Color.Blue);
|
||||||
g.DrawRectangle(pen, _startPosX.Value + 85, _startPosY.Value + 5, 10, 10);
|
g.DrawRectangle(pen, _startPosX.Value + 85, _startPosY.Value + 5 + 10, 10, 10);
|
||||||
g.DrawRectangle(pen, _startPosX.Value + 70, _startPosY.Value + 5, 10, 10);
|
g.DrawRectangle(pen, _startPosX.Value + 70, _startPosY.Value + 5 + 10, 10, 10);
|
||||||
g.DrawRectangle(pen, _startPosX.Value + 5, _startPosY.Value + 5, 10, 10);
|
g.DrawRectangle(pen, _startPosX.Value + 10, _startPosY.Value + 5 + 10, 10, 10);
|
||||||
//труба
|
//труба
|
||||||
if (EntityLocomotive.ExehaustPipe)
|
if (EntityLocomotive.ExehaustPipe)
|
||||||
{
|
{
|
||||||
Brush greyBrush = new SolidBrush(Color.Gray);
|
Brush greyBrush = new SolidBrush(Color.Gray);
|
||||||
g.FillRectangle(greyBrush, _startPosX.Value + 80, _startPosY.Value - 10, 5, 10);
|
g.FillRectangle(greyBrush, _startPosX.Value + 80, _startPosY.Value, 5, 10);
|
||||||
g.DrawRectangle(pen, _startPosX.Value + 80, _startPosY.Value - 10, 5, 10);
|
g.DrawRectangle(pen, _startPosX.Value + 80, _startPosY.Value, 5, 10);
|
||||||
}
|
}
|
||||||
// отсек для топлива
|
// отсек для топлива
|
||||||
if (EntityLocomotive.FuelCompartment)
|
if (EntityLocomotive.FuelCompartment)
|
||||||
{
|
{
|
||||||
g.FillRectangle(bodyBrush, _startPosX.Value + 20, _startPosY.Value + 10, 10, 20);
|
g.FillRectangle(bodyBrush, _startPosX.Value + 25, _startPosY.Value + 10 + 10, 10, 20);
|
||||||
g.DrawRectangle(pen, _startPosX.Value + 20, _startPosY.Value + 10, 10, 20);
|
g.DrawRectangle(pen, _startPosX.Value + 25, _startPosY.Value + 10 + 10, 10, 20);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,106 +29,110 @@
|
|||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LocomotiveProject));
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LocomotiveProject));
|
||||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
pictureBox1 = new PictureBox();
|
||||||
this.pictureBoxLocomotive = new System.Windows.Forms.PictureBox();
|
pictureBoxLocomotive = new PictureBox();
|
||||||
this.create = new System.Windows.Forms.Button();
|
create = new Button();
|
||||||
this.buttonUp = new System.Windows.Forms.Button();
|
buttonUp = new Button();
|
||||||
this.buttonDown = new System.Windows.Forms.Button();
|
buttonDown = new Button();
|
||||||
this.buttonLeft = new System.Windows.Forms.Button();
|
buttonLeft = new Button();
|
||||||
this.buttonRight = new System.Windows.Forms.Button();
|
buttonRight = new Button();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxLocomotive)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)pictureBoxLocomotive).BeginInit();
|
||||||
this.SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// pictureBox1
|
// pictureBox1
|
||||||
//
|
//
|
||||||
this.pictureBox1.Location = new System.Drawing.Point(0, 0);
|
pictureBox1.Location = new Point(0, 0);
|
||||||
this.pictureBox1.Name = "pictureBox1";
|
pictureBox1.Name = "pictureBox1";
|
||||||
this.pictureBox1.Size = new System.Drawing.Size(100, 50);
|
pictureBox1.Size = new Size(100, 50);
|
||||||
this.pictureBox1.TabIndex = 0;
|
pictureBox1.TabIndex = 0;
|
||||||
this.pictureBox1.TabStop = false;
|
pictureBox1.TabStop = false;
|
||||||
//
|
//
|
||||||
// pictureBoxLocomotive
|
// pictureBoxLocomotive
|
||||||
//
|
//
|
||||||
this.pictureBoxLocomotive.Dock = System.Windows.Forms.DockStyle.Fill;
|
pictureBoxLocomotive.Dock = DockStyle.Fill;
|
||||||
this.pictureBoxLocomotive.Location = new System.Drawing.Point(0, 0);
|
pictureBoxLocomotive.Location = new Point(0, 0);
|
||||||
this.pictureBoxLocomotive.Name = "pictureBoxLocomotive";
|
pictureBoxLocomotive.Name = "pictureBoxLocomotive";
|
||||||
this.pictureBoxLocomotive.Size = new System.Drawing.Size(800, 450);
|
pictureBoxLocomotive.Size = new Size(800, 450);
|
||||||
this.pictureBoxLocomotive.TabIndex = 1;
|
pictureBoxLocomotive.TabIndex = 1;
|
||||||
this.pictureBoxLocomotive.TabStop = false;
|
pictureBoxLocomotive.TabStop = false;
|
||||||
//
|
//
|
||||||
// create
|
// create
|
||||||
//
|
//
|
||||||
this.create.Location = new System.Drawing.Point(12, 415);
|
create.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||||
this.create.Name = "create";
|
create.Location = new Point(12, 415);
|
||||||
this.create.Size = new System.Drawing.Size(75, 23);
|
create.Name = "create";
|
||||||
this.create.TabIndex = 2;
|
create.Size = new Size(75, 23);
|
||||||
this.create.Text = "создать";
|
create.TabIndex = 2;
|
||||||
this.create.UseVisualStyleBackColor = true;
|
create.Text = "создать";
|
||||||
this.create.Click += new System.EventHandler(this.create_Click);
|
create.UseVisualStyleBackColor = true;
|
||||||
|
create.Click += create_Click;
|
||||||
//
|
//
|
||||||
// buttonUp
|
// buttonUp
|
||||||
//
|
//
|
||||||
this.buttonUp.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("buttonUp.BackgroundImage")));
|
buttonUp.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||||
this.buttonUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
|
buttonUp.BackgroundImage = (Image)resources.GetObject("buttonUp.BackgroundImage");
|
||||||
this.buttonUp.Location = new System.Drawing.Point(691, 362);
|
buttonUp.BackgroundImageLayout = ImageLayout.Stretch;
|
||||||
this.buttonUp.Name = "buttonUp";
|
buttonUp.Location = new Point(691, 362);
|
||||||
this.buttonUp.Size = new System.Drawing.Size(35, 35);
|
buttonUp.Name = "buttonUp";
|
||||||
this.buttonUp.TabIndex = 3;
|
buttonUp.Size = new Size(35, 35);
|
||||||
this.buttonUp.UseVisualStyleBackColor = true;
|
buttonUp.TabIndex = 3;
|
||||||
this.buttonUp.Click += new System.EventHandler(this.ButtonMove_Click);
|
buttonUp.UseVisualStyleBackColor = true;
|
||||||
|
buttonUp.Click += ButtonMove_Click;
|
||||||
//
|
//
|
||||||
// buttonDown
|
// buttonDown
|
||||||
//
|
//
|
||||||
this.buttonDown.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("buttonDown.BackgroundImage")));
|
buttonDown.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||||
this.buttonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
|
buttonDown.BackgroundImage = (Image)resources.GetObject("buttonDown.BackgroundImage");
|
||||||
this.buttonDown.Location = new System.Drawing.Point(691, 403);
|
buttonDown.BackgroundImageLayout = ImageLayout.Stretch;
|
||||||
this.buttonDown.Name = "buttonDown";
|
buttonDown.Location = new Point(691, 403);
|
||||||
this.buttonDown.Size = new System.Drawing.Size(35, 35);
|
buttonDown.Name = "buttonDown";
|
||||||
this.buttonDown.TabIndex = 4;
|
buttonDown.Size = new Size(35, 35);
|
||||||
this.buttonDown.UseVisualStyleBackColor = true;
|
buttonDown.TabIndex = 4;
|
||||||
this.buttonDown.Click += new System.EventHandler(this.ButtonMove_Click);
|
buttonDown.UseVisualStyleBackColor = true;
|
||||||
|
buttonDown.Click += ButtonMove_Click;
|
||||||
//
|
//
|
||||||
// buttonLeft
|
// buttonLeft
|
||||||
//
|
//
|
||||||
this.buttonLeft.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("buttonLeft.BackgroundImage")));
|
buttonLeft.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||||
this.buttonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
|
buttonLeft.BackgroundImage = (Image)resources.GetObject("buttonLeft.BackgroundImage");
|
||||||
this.buttonLeft.Location = new System.Drawing.Point(650, 403);
|
buttonLeft.BackgroundImageLayout = ImageLayout.Stretch;
|
||||||
this.buttonLeft.Name = "buttonLeft";
|
buttonLeft.Location = new Point(650, 403);
|
||||||
this.buttonLeft.Size = new System.Drawing.Size(35, 35);
|
buttonLeft.Name = "buttonLeft";
|
||||||
this.buttonLeft.TabIndex = 5;
|
buttonLeft.Size = new Size(35, 35);
|
||||||
this.buttonLeft.UseVisualStyleBackColor = true;
|
buttonLeft.TabIndex = 5;
|
||||||
this.buttonLeft.Click += new System.EventHandler(this.ButtonMove_Click);
|
buttonLeft.UseVisualStyleBackColor = true;
|
||||||
|
buttonLeft.Click += ButtonMove_Click;
|
||||||
//
|
//
|
||||||
// buttonRight
|
// buttonRight
|
||||||
//
|
//
|
||||||
this.buttonRight.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("buttonRight.BackgroundImage")));
|
buttonRight.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||||
this.buttonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
|
buttonRight.BackgroundImage = (Image)resources.GetObject("buttonRight.BackgroundImage");
|
||||||
this.buttonRight.Location = new System.Drawing.Point(732, 403);
|
buttonRight.BackgroundImageLayout = ImageLayout.Stretch;
|
||||||
this.buttonRight.Name = "buttonRight";
|
buttonRight.Location = new Point(732, 403);
|
||||||
this.buttonRight.Size = new System.Drawing.Size(35, 35);
|
buttonRight.Name = "buttonRight";
|
||||||
this.buttonRight.TabIndex = 6;
|
buttonRight.Size = new Size(35, 35);
|
||||||
this.buttonRight.UseVisualStyleBackColor = true;
|
buttonRight.TabIndex = 6;
|
||||||
this.buttonRight.Click += new System.EventHandler(this.ButtonMove_Click);
|
buttonRight.UseVisualStyleBackColor = true;
|
||||||
|
buttonRight.Click += ButtonMove_Click;
|
||||||
//
|
//
|
||||||
// LocomotiveProject
|
// LocomotiveProject
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
ClientSize = new Size(800, 450);
|
||||||
this.Controls.Add(this.buttonRight);
|
Controls.Add(buttonRight);
|
||||||
this.Controls.Add(this.buttonLeft);
|
Controls.Add(buttonLeft);
|
||||||
this.Controls.Add(this.buttonDown);
|
Controls.Add(buttonDown);
|
||||||
this.Controls.Add(this.buttonUp);
|
Controls.Add(buttonUp);
|
||||||
this.Controls.Add(this.create);
|
Controls.Add(create);
|
||||||
this.Controls.Add(this.pictureBoxLocomotive);
|
Controls.Add(pictureBoxLocomotive);
|
||||||
this.Controls.Add(this.pictureBox1);
|
Controls.Add(pictureBox1);
|
||||||
this.Name = "LocomotiveProject";
|
Name = "LocomotiveProject";
|
||||||
this.Text = "Тепловоз";
|
Text = "Тепловоз";
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxLocomotive)).EndInit();
|
((System.ComponentModel.ISupportInitialize)pictureBoxLocomotive).EndInit();
|
||||||
this.ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -39,20 +39,20 @@ namespace LocomativeProject
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void create_Click(object sender, EventArgs e)
|
private void create_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Random random = new ();
|
Random random = new();
|
||||||
_drawningLocomotive = new DrawningLocomotive();
|
_drawningLocomotive = new DrawningLocomotive();
|
||||||
_drawningLocomotive.Init
|
_drawningLocomotive.Init
|
||||||
(
|
(
|
||||||
random.Next(100, 300),
|
random.Next(100, 300),
|
||||||
random.Next(1000, 3000),
|
random.Next(1000, 3000),
|
||||||
Color.FromArgb( random.Next(0, 256), random.Next(0, 256), random.Next(0, 256) ),
|
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)),
|
||||||
Color.FromArgb( random.Next(0, 256), random.Next(0, 256), random.Next(0, 256) ),
|
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)),
|
||||||
|
Convert.ToBoolean(random.Next(0, 2)),
|
||||||
Convert.ToBoolean(random.Next(0, 2)),
|
Convert.ToBoolean(random.Next(0, 2)),
|
||||||
Convert.ToBoolean( random.Next(0, 2) ),
|
|
||||||
random.Next(2, 6)
|
random.Next(2, 6)
|
||||||
);
|
);
|
||||||
_drawningLocomotive.SetPictureSize( pictureBoxLocomotive.Width, pictureBoxLocomotive.Height );
|
_drawningLocomotive.SetPictureSize(pictureBoxLocomotive.Width, pictureBoxLocomotive.Height);
|
||||||
_drawningLocomotive.SetPosition( random.Next(10, 100), random.Next(10, 100) );
|
_drawningLocomotive.SetPosition(random.Next(10, 100), random.Next(10, 100));
|
||||||
Draw();
|
Draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,64 @@
|
|||||||
<root>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
@ -177,7 +237,7 @@
|
|||||||
<data name="buttonDown.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="buttonDown.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
iVBORw0KGgoAAAANSUhEUgAAAf0AAAIBCAYAAABDdGZ3AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
iVBORw0KGgoAAAANSUhEUgAAAf0AAAIBCAYAAABDdGZ3AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||||
vQAADr0BR/uQrQAAIv9JREFUeF7t3YuS29axheH4KjmpvP97plyS7zrp2V4+bYQaSjNigyC+v+ovguRE
|
vAAADrwBlbxySQAAIv9JREFUeF7t3YuS29axheH4KjmpvP97plyS7zrp2V4+bYQaSjNigyC+v+ovguRE
|
||||||
sTnNvXYDaPkfH4Cdef/+/Z9HHz788ssvT4/ffPPNh3/84x/kof3qq6+eHn///fenuk59F3kNmEToY1d+
|
sTnNvXYDaPkfH4Cdef/+/Z9HHz788ssvT4/ffPPNh3/84x/kof3qq6+eHn///fenuk59F3kNmEToY1d+
|
||||||
+umnP4/Wgvjtt9/+tWAKfj6Cb968eQr/8PPPP3/4448/hD52Qehjdyr4f/vtt6eFsYK+Bz95ZL///vun
|
+umnP4/Wgvjtt9/+tWAKfj6Cb968eQr/8PPPP3/4448/hD52Qehjdyr4f/vtt6eFsYK+Bz95ZL///vun
|
||||||
x3T8PfyBPRD62JV0O2/fvv3bYvndd9/97Tl5VH/44Yenx17TRT/VD0wh9LEr1eF//fXXTwthdUE5rlOi
|
x3T8PfyBPRD62JV0O2/fvv3bYvndd9/97Tl5VH/44Yenx17TRT/VD0wh9LEr1eF//fXXTwthdUE5rlOi
|
||||||
@ -332,7 +392,7 @@
|
|||||||
<data name="buttonLeft.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="buttonLeft.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
iVBORw0KGgoAAAANSUhEUgAAAgEAAAIHCAYAAAAGv498AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
iVBORw0KGgoAAAANSUhEUgAAAgEAAAIHCAYAAAAGv498AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||||
vQAADr0BR/uQrQAAHmBJREFUeF7t3YuyG0XWrVH65gsd/f7vSRDGBgPNSpibtLy9JVtLUlXlGBGfJMzt
|
vAAADrwBlbxySQAAHmBJREFUeF7t3YuyG0XWrVH65gsd/f7vSRDGBgPNSpibtLy9JVtLUlXlGBGfJMzt
|
||||||
Pw3HNaWSk+9+BwCWZAQAwKKMAABYlBEAAIsyAgBgUUYAACzKCACARRkBALAoIwAAFmUEAMCijAAAWJQR
|
Pw3HNaWSk+9+BwCWZAQAwKKMAABYlBEAAIsyAgBgUUYAACzKCACARRkBALAoIwAAFmUEAMCijAAAWJQR
|
||||||
AACLMgIAYFFGAAAsyggAgEUZAQCwKCMAABZlBADAoowAAFiUEQAAizICAGBRRgAALMoIAIBFGQEAsCgj
|
AACLMgIAYFFGAAAsyggAgEUZAQCwKCMAABZlBADAoowAAFiUEQAAizICAGBRRgAALMoIAIBFGQEAsCgj
|
||||||
AAAWZQQAwKKMAABYlBEAAIsyAgBgUUYAACzKCACARRkBALAoIwCu9PHjx79e/f77r7/++vtvv/322XN8
|
AAAWZQQAwKKMAABYlBEAAIsyAgBgUUYAACzKCACARRkBALAoIwCu9PHjx79e/f77r7/++vtvv/322XN8
|
||||||
@ -468,7 +528,7 @@
|
|||||||
<data name="buttonRight.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="buttonRight.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||||
vgAADr4B6kKxwAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAABq4SURBVHhe7d1X
|
vQAADr0BR/uQrQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAABq4SURBVHhe7d1X
|
||||||
0F1lvcfxAOMMioCAQbBhL9jBgqKCXcCC0WgsGFSMElIgBEgU4+g4OuOV114w44W3inKBBSxYsEdFRQWj
|
0F1lvcfxAOMMioCAQbBhL9jBgqKCXcCC0WgsGFSMElIgBEgU4+g4OuOV114w44W3inKBBSxYsEdFRQWj
|
||||||
YAkaFYMFQcjyeZKlIcmTt+z3v/deaz2fz8z3cI5Jdlkvx/9vHI9nUQMAVMcAAIAKGQAAUCEDAAAqZAAA
|
YAkaFYMFQcjyeZKlIcmTt+z3v/deaz2fz8z3cI5Jdlkvx/9vHI9nUQMAVMcAAIAKGQAAUCEDAAAqZAAA
|
||||||
QIUMAACokAEAABUyAACgQgYAAFTIAACAChkAAFAhAwAAKmQAAECFDAAAqJABAAAVMgAAoEIGAABUyAAA
|
QIUMAACokAEAABUyAACgQgYAAFTIAACAChkAAFAhAwAAKmQAAECFDAAAqJABAAAVMgAAoEIGAABUyAAA
|
||||||
|
Loading…
Reference in New Issue
Block a user