Commit 6567ac0f LN

点位调试页面按钮更改,类型改为图片

1 个父辈 bec15b6b
...@@ -585,7 +585,27 @@ ...@@ -585,7 +585,27 @@
<Content Include="image\form\NS.ico"> <Content Include="image\form\NS.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<None Include="image\form\NS.png" /> <Content Include="image\form\NS.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="image\form\type1s.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="image\form\type2s.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="image\form\type3s.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="image\form\type4s.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="image\form\type5s.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="image\form\type6s.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="image\form\up.png"> <Content Include="image\form\up.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
...@@ -595,7 +615,7 @@ ...@@ -595,7 +615,7 @@
<Content Include="image\form\type2.png"> <Content Include="image\form\type2.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="image\form\left.png"> <Content Include="image\form\right.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="image\form\type6.png"> <Content Include="image\form\type6.png">
...@@ -604,7 +624,7 @@ ...@@ -604,7 +624,7 @@
<Content Include="image\form\type1.png"> <Content Include="image\form\type1.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="image\form\right.png"> <Content Include="image\form\left.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="image\form\type4.png"> <Content Include="image\form\type4.png">
......

1018 字节 | 宽: | 高:

1.0 KB | 宽: | 高:

TSA-V/image/form/left.png
TSA-V/image/form/left.png
TSA-V/image/form/left.png
TSA-V/image/form/left.png
  • 两方对比
  • 交换覆盖
  • 透明覆盖

1.0 KB | 宽: | 高:

1018 字节 | 宽: | 高:

TSA-V/image/form/right.png
TSA-V/image/form/right.png
TSA-V/image/form/right.png
TSA-V/image/form/right.png
  • 两方对比
  • 交换覆盖
  • 透明覆盖
...@@ -25,6 +25,14 @@ namespace UserFromControl ...@@ -25,6 +25,14 @@ namespace UserFromControl
public static Image imgType5; public static Image imgType5;
public static Image imgType6; public static Image imgType6;
public static Image imgType1s;
public static Image imgType2s;
public static Image imgType3s;
public static Image imgType4s;
public static Image imgType5s;
public static Image imgType6s;
/// <summary> /// <summary>
/// 是否已经初始化过了 /// 是否已经初始化过了
/// </summary> /// </summary>
...@@ -48,6 +56,14 @@ namespace UserFromControl ...@@ -48,6 +56,14 @@ namespace UserFromControl
imgType4 = Image.FromFile(Application.StartupPath + "\\image\\form\\type4.png"); imgType4 = Image.FromFile(Application.StartupPath + "\\image\\form\\type4.png");
imgType5 = Image.FromFile(Application.StartupPath + "\\image\\form\\type5.png"); imgType5 = Image.FromFile(Application.StartupPath + "\\image\\form\\type5.png");
imgType6 = Image.FromFile(Application.StartupPath + "\\image\\form\\type6.png"); imgType6 = Image.FromFile(Application.StartupPath + "\\image\\form\\type6.png");
imgType1s = Image.FromFile(Application.StartupPath + "\\image\\form\\type1s.png");
imgType2s = Image.FromFile(Application.StartupPath + "\\image\\form\\type2s.png");
imgType3s = Image.FromFile(Application.StartupPath + "\\image\\form\\type3s.png");
imgType4s = Image.FromFile(Application.StartupPath + "\\image\\form\\type4s.png");
imgType5s = Image.FromFile(Application.StartupPath + "\\image\\form\\type5s.png");
imgType6s = Image.FromFile(Application.StartupPath + "\\image\\form\\type6s.png");
} }
catch (Exception ex) catch (Exception ex)
{ {
......
...@@ -24,7 +24,11 @@ namespace UserFromControl ...@@ -24,7 +24,11 @@ namespace UserFromControl
public delegate bool ShowPointDelegate(ProjectorPInfo p); public delegate bool ShowPointDelegate(ProjectorPInfo p);
public event ShowPointDelegate ShowPointEvent; public event ShowPointDelegate ShowPointEvent;
public ProjectorControl() public ProjectorControl()
{ {
if (ImageManager.IsInit == false)
{
ImageManager.Init();
}
InitializeComponent(); InitializeComponent();
if (LastStepIndexMap == null) if (LastStepIndexMap == null)
{ {
...@@ -44,6 +48,17 @@ namespace UserFromControl ...@@ -44,6 +48,17 @@ namespace UserFromControl
PolaritiesType = 0; PolaritiesType = 0;
numSizeX.Maximum = MaxX / 2; numSizeX.Maximum = MaxX / 2;
numSizeY.Maximum=MaxY/ 2; numSizeY.Maximum=MaxY/ 2;
btnUp.BackgroundImage = ImageManager.imgUp;
btnDown.BackgroundImage = ImageManager.imgDown;
btnLeft.BackgroundImage = ImageManager.imgLeft;
btnRight.BackgroundImage = ImageManager.imgRight;
pictureBox1.Image = ImageManager.imgType1;
pictureBox2.Image = ImageManager.imgType2;
pictureBox3.Image = ImageManager.imgType3;
pictureBox4.Image = ImageManager.imgType4;
pictureBox5.Image = ImageManager.imgType5;
pictureBox6.Image = ImageManager.imgType6;
} }
public void loadTypeList(string[] list, string[] dirlist,Dictionary<string,string> controlTextMap) public void loadTypeList(string[] list, string[] dirlist,Dictionary<string,string> controlTextMap)
{ {
...@@ -80,6 +95,12 @@ namespace UserFromControl ...@@ -80,6 +95,12 @@ namespace UserFromControl
btnLeft.Text = controlTextMap["btnLeft_Text"]; btnLeft.Text = controlTextMap["btnLeft_Text"];
btnRight.Text = controlTextMap["btnRight_Text"]; btnRight.Text = controlTextMap["btnRight_Text"];
lblPolarities.Text = controlTextMap["lblPolarities_Text"]; lblPolarities.Text = controlTextMap["lblPolarities_Text"];
btnDown.Text = "";
btnUp.Text = "";
btnLeft.Text = "";
btnRight.Text = "";
// //
} }
public string GroupName public string GroupName
...@@ -203,9 +224,9 @@ namespace UserFromControl ...@@ -203,9 +224,9 @@ namespace UserFromControl
if (!(cmbType.SelectedIndex + 1).Equals(lastType)) if (!(cmbType.SelectedIndex + 1).Equals(lastType))
{ {
lastType = cmbType.SelectedIndex + 1; lastType = cmbType.SelectedIndex + 1;
DrawPoint(lastType,lastPolaritiesType); DrawPoint(lastType,lastPolaritiesType);
ShowCurrPoint(); ShowCurrPoint();
TypeUpdate(cmbType.SelectedIndex);
} }
} }
private int lastType=1; private int lastType=1;
...@@ -341,6 +362,10 @@ namespace UserFromControl ...@@ -341,6 +362,10 @@ namespace UserFromControl
return 10; return 10;
} }
private List<string> typeList = new List<string>(); private List<string> typeList = new List<string>();
private List<PictureBox> pictureBoxes = new List<PictureBox>();
private List<Image> picDefImages = new List<Image>();
private List<Image> picSelImages = new List<Image>();
private void ProjectorControl_Load(object sender, EventArgs e) private void ProjectorControl_Load(object sender, EventArgs e)
{ {
try try
...@@ -385,7 +410,29 @@ namespace UserFromControl ...@@ -385,7 +410,29 @@ namespace UserFromControl
{ {
cmbStep.SelectedIndex = cmbStep.Items.Count / 2; cmbStep.SelectedIndex = cmbStep.Items.Count / 2;
} }
pictureBoxes.Add(pictureBox1);
pictureBoxes.Add(pictureBox2);
pictureBoxes.Add(pictureBox3);
pictureBoxes.Add(pictureBox4);
pictureBoxes.Add(pictureBox5);
pictureBoxes.Add(pictureBox6);
picDefImages.Add(ImageManager.imgType1);
picDefImages.Add(ImageManager.imgType2);
picDefImages.Add(ImageManager.imgType3);
picDefImages.Add(ImageManager.imgType4);
picDefImages.Add(ImageManager.imgType5);
picDefImages.Add(ImageManager.imgType6);
picSelImages.Add(ImageManager.imgType1s);
picSelImages.Add(ImageManager.imgType2s);
picSelImages.Add(ImageManager.imgType3s);
picSelImages.Add(ImageManager.imgType4s);
picSelImages.Add(ImageManager.imgType5s);
picSelImages.Add(ImageManager.imgType6s);
TypeUpdate(cmbType.SelectedIndex);
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -533,108 +580,7 @@ namespace UserFromControl ...@@ -533,108 +580,7 @@ namespace UserFromControl
int pY = y + sizeY / 2 + lineLength + plusSize; int pY = y + sizeY / 2 + lineLength + plusSize;
g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY)); g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize)); g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
} }
//else if (type.Equals(7))
//{
// sizeX = 12;
// sizeY = 36;
// int plusSize = sizeX / 2;
// int pX = x;
// int pY = y - sizeY / 2 - lineLength - plusSize;
// g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
// g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
// g.DrawRectangle(pen, x - sizeX / 2, y - sizeY / 2, sizeX, sizeY);
//}
//else if (type.Equals(8))
//{
// sizeX = 12;
// sizeY = 36;
// g.DrawRectangle(pen, x - sizeX / 2, y - sizeY / 2, sizeX, sizeY);
// int plusSize = sizeX / 2;
// int pX = x;
// int pY = y + sizeY / 2 + lineLength + plusSize;
// g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
// g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
//}
//else if (type.Equals(9))
//{
// sizeX = 36;
// sizeY = 12;
// g.DrawRectangle(pen, x - sizeX / 2, y - sizeY / 2, sizeX, sizeY);
// int plusSize = sizeY / 2;
// int pX = x - sizeX / 2 - lineLength - plusSize;
// int pY = y;
// g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
// g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
//}
//else if (type.Equals(10))
//{
// sizeX = 36;
// sizeY = 12;
// g.DrawRectangle(pen, x - sizeX / 2, y - sizeY / 2, sizeX, sizeY);
// int plusSize = sizeY / 2;
// int pX = x + sizeX / 2 + lineLength + plusSize;
// int pY = y;
// g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
// g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
//}
//else if (type.Equals(11))
//{
// sizeX = 12;
// sizeY = 36;
// int plusSize = sizeX / 2;
// int pX = x-6;
// int pY = y - sizeY / 2 - lineLength - plusSize;
// g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
// g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
// g.DrawRectangle(pen, x - sizeX / 2, y - sizeY / 2, sizeX, sizeY);
//}
//else if (type.Equals(12))
//{
// sizeX = 12;
// sizeY = 36;
// int plusSize = sizeX / 2;
// int pX = x + 6;
// int pY = y - sizeY / 2 - lineLength - plusSize;
// g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
// g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
// g.DrawRectangle(pen, x - sizeX / 2, y - sizeY / 2, sizeX, sizeY);
//}
//else if (type.Equals(13))
//{
// sizeX = 12;
// sizeY = 36;
// g.DrawRectangle(pen, x - sizeX / 2, y - sizeY / 2, sizeX, sizeY);
// int plusSize = sizeX / 2;
// int pX = x-6;
// int pY = y + sizeY / 2 + lineLength + plusSize;
// g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
// g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
//}
//else if (type.Equals(14))
//{
// sizeX = 12;
// sizeY = 36;
// g.DrawRectangle(pen, x - sizeX / 2, y - sizeY / 2, sizeX, sizeY);
// int plusSize = sizeX / 2;
// int pX = x + 6;
// int pY = y + sizeY / 2 + lineLength + plusSize;
// g.DrawLine(pen, new Point(pX - plusSize, pY), new Point(pX + plusSize, pY));
// g.DrawLine(pen, new Point(pX, pY - plusSize), new Point(pX, pY + plusSize));
//}
//else
//{
// g.FillEllipse(myBrush, new Rectangle(x - sizeX / 2, y - sizeY / 2, sizeX, sizeY));//画实心椭圆
//}
} }
private void group_Paint(object sender, PaintEventArgs e) private void group_Paint(object sender, PaintEventArgs e)
...@@ -663,5 +609,50 @@ namespace UserFromControl ...@@ -663,5 +609,50 @@ namespace UserFromControl
this.PenWidth = penWidth; this.PenWidth = penWidth;
this.PolaritiesType = polaritiesType; this.PolaritiesType = polaritiesType;
} }
private void TypeUpdate(int index)
{
for (int i = 0; i < pictureBoxes.Count; i++)
{
if (i.Equals(index))
{
pictureBoxes[i].Image = picSelImages[i];
}
else
{
pictureBoxes[i].Image = picDefImages[i];
}
}
}
private void pictureBox1_Click(object sender, EventArgs e)
{
PointType = 1;
}
private void pictureBox3_Click(object sender, EventArgs e)
{
PointType = 3;
}
private void pictureBox2_Click(object sender, EventArgs e)
{
PointType = 2;
}
private void pictureBox4_Click(object sender, EventArgs e)
{
PointType = 4;
}
private void pictureBox5_Click(object sender, EventArgs e)
{
PointType = 5;
}
private void pictureBox6_Click(object sender, EventArgs e)
{
PointType = 6;
}
} }
} }
...@@ -59,5 +59,15 @@ namespace UserFromControl.Properties { ...@@ -59,5 +59,15 @@ namespace UserFromControl.Properties {
resourceCulture = value; resourceCulture = value;
} }
} }
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap type1 {
get {
object obj = ResourceManager.GetObject("type1", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
} }
} }
...@@ -117,4 +117,8 @@ ...@@ -117,4 +117,8 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="type1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\type1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>
\ No newline at end of file \ No newline at end of file
...@@ -121,6 +121,7 @@ ...@@ -121,6 +121,7 @@
<Content Include="image\green1.png"> <Content Include="image\green1.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<None Include="Resources\type1.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="packages.config" /> <None Include="packages.config" />
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!