Merge pull request #31 from IngenerkaTeamCenter/ArkLightning-patch-1

Сохранение и очистка картинки
This commit is contained in:
Mikhail Abramov 2018-04-07 06:22:52 +03:00 committed by GitHub
commit 7cadd868cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 7 deletions

View file

@ -59,10 +59,12 @@ namespace WindowsFormsApplication1
this.ButtonAddChar = new System.Windows.Forms.Button();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.openSpace = new System.Windows.Forms.PictureBox();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.PictureBoxBackground)).BeginInit();
this.panel2.SuspendLayout();
this.panel3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.openSpace)).BeginInit();
this.SuspendLayout();
//
// LabelData
@ -124,6 +126,7 @@ namespace WindowsFormsApplication1
this.label13.Size = new System.Drawing.Size(180, 13);
this.label13.TabIndex = 23;
this.label13.Text = "ИНФОРМАЦИЯ О ПЕРСОНАЖАХ";
//
// PictureBoxBackground
//
this.PictureBoxBackground.Location = new System.Drawing.Point(17, 160);
@ -174,7 +177,7 @@ namespace WindowsFormsApplication1
// SaveCharButton
//
this.SaveCharButton.Dock = System.Windows.Forms.DockStyle.Bottom;
this.SaveCharButton.Location = new System.Drawing.Point(0, 315);
this.SaveCharButton.Location = new System.Drawing.Point(0, 320);
this.SaveCharButton.Name = "SaveCharButton";
this.SaveCharButton.Size = new System.Drawing.Size(377, 30);
this.SaveCharButton.TabIndex = 3;
@ -184,6 +187,7 @@ namespace WindowsFormsApplication1
//
// panel3
//
this.panel3.Controls.Add(this.openSpace);
this.panel3.Controls.Add(this.SpriteNumberLabel);
this.panel3.Controls.Add(this.SpriteNumberTextBox);
this.panel3.Controls.Add(this.OpenButton);
@ -201,7 +205,7 @@ namespace WindowsFormsApplication1
this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel3.Location = new System.Drawing.Point(0, 26);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(392, 319);
this.panel3.Size = new System.Drawing.Size(377, 324);
this.panel3.TabIndex = 2;
this.panel3.Visible = false;
//
@ -330,7 +334,7 @@ namespace WindowsFormsApplication1
// SaveMultButton
//
this.SaveMultButton.Dock = System.Windows.Forms.DockStyle.Bottom;
this.SaveMultButton.Location = new System.Drawing.Point(0, 345);
this.SaveMultButton.Location = new System.Drawing.Point(0, 350);
this.SaveMultButton.Name = "SaveMultButton";
this.SaveMultButton.Size = new System.Drawing.Size(377, 30);
this.SaveMultButton.TabIndex = 1;
@ -353,6 +357,14 @@ namespace WindowsFormsApplication1
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// openSpace
//
this.openSpace.Location = new System.Drawing.Point(65, 206);
this.openSpace.Name = "openSpace";
this.openSpace.Size = new System.Drawing.Size(245, 55);
this.openSpace.TabIndex = 17;
this.openSpace.TabStop = false;
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -370,6 +382,7 @@ namespace WindowsFormsApplication1
this.panel2.ResumeLayout(false);
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.openSpace)).EndInit();
this.ResumeLayout(false);
}
@ -407,5 +420,6 @@ namespace WindowsFormsApplication1
private System.Windows.Forms.Button dobavitFonButton;
private System.Windows.Forms.PictureBox PictureBoxBackground;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.PictureBox openSpace;
}
}

View file

@ -21,6 +21,7 @@ namespace WindowsFormsApplication1
public int nomer;
public String coord;
public String adress;
};
Person[] persons = new Person[200];
@ -139,6 +140,7 @@ namespace WindowsFormsApplication1
nomerPersa++;
yPersa = yPersa + 30;
openSpace.Image = null;
}
private void circle_create_person(string filename, string name)
@ -200,9 +202,8 @@ namespace WindowsFormsApplication1
{
if (openFileDialog1.ShowDialog() == DialogResult.Cancel)
return;
string filename = openFileDialog1.FileName;
string fileText =File.ReadAllText(filename);
nazvanieTextBox.Text = fileText;
openSpace.Image = Image.FromFile(openFileDialog1.FileName);
persons[nomerPersa].adress = openFileDialog1.FileName;
}
private void AddBackArtClick(object sender, EventArgs e)
@ -272,8 +273,21 @@ namespace WindowsFormsApplication1
if (sender.Equals(persons[nomer].b1))
{
TextBoxWall1.Text = persons[nomer].coord;
if (!String.IsNullOrEmpty(persons[nomer].adress))
{
openSpace.Image = Image.FromFile(persons[nomer].adress);
}
else
{
openSpace.Image = null;
}
}
}
}
private void OpenSpace_Click(object sender, EventArgs e)
{
}
}
}

View file

@ -9,8 +9,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WindowsFormsApplication1</RootNamespace>
<AssemblyName>WindowsFormsApplication1</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@ -21,6 +22,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@ -30,6 +32,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@ -66,7 +69,9 @@
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>