版本初始化,建立主窗体页面

This commit is contained in:
liu.wenjie
2019-07-13 19:28:22 +08:00
committed by liu.wenjie
commit 32b9b5ed0b
270 changed files with 360846 additions and 0 deletions

View File

@@ -0,0 +1,160 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ViewROI</RootNamespace>
<AssemblyName>HWindow_Tool</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<StartupObject>
</StartupObject>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<PlatformTarget>AnyCPU</PlatformTarget>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<PlatformTarget>AnyCPU</PlatformTarget>
<OutputPath>bin\Release\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="halcondotnet">
<HintPath>C:\Program Files\MVTec\HALCON-17.12-Progress\bin\dotnet35\halcondotnet.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization.Formatters.Soap" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Config\Circle.cs" />
<Compile Include="Config\CircularArc.cs" />
<Compile Include="Config\HObjectWithColor.cs" />
<Compile Include="Config\Line.cs" />
<Compile Include="Config\Rectangle1.cs" />
<Compile Include="Config\Rectangle2.cs" />
<Compile Include="Config\SerializeHelper.cs" />
<Compile Include="HWindow_Final.cs">
<SubType>UserControl</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Compile>
<Compile Include="HWindow_Final.designer.cs">
<DependentUpon>HWindow_Final.cs</DependentUpon>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Compile>
<Compile Include="Model\GraphicsContext.cs" />
<Compile Include="Model\HObjectEntry.cs" />
<Compile Include="Model\HWndCtrl.cs" />
<Compile Include="Model\IViewWindow.cs" />
<Compile Include="Model\ROI.cs" />
<Compile Include="Model\ROICircle.cs" />
<Compile Include="Model\ROICircularArc.cs" />
<Compile Include="Model\ROIController.cs" />
<Compile Include="Model\RoiData.cs" />
<Compile Include="Model\ROILine.cs" />
<Compile Include="Model\ROIRectangle1.cs" />
<Compile Include="Model\ROIRectangle2.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ViewWindow.cs" />
<EmbeddedResource Include="HWindow_Final.resx">
<DependentUpon>HWindow_Final.cs</DependentUpon>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
<None Include="ClassDiagram1.cd" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,26 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HWindow_Tool", "HWindow_Tool.csproj", "{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}.Debug|x64.ActiveCfg = Debug|x64
{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}.Debug|x64.Build.0 = Debug|x64
{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}.Debug|x86.ActiveCfg = Debug|x86
{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}.Debug|x86.Build.0 = Debug|x86
{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}.Release|x64.ActiveCfg = Release|x64
{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}.Release|x64.Build.0 = Release|x64
{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}.Release|x86.ActiveCfg = Release|x86
{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Binary file not shown.

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram MajorVersion="1" MinorVersion="1">
<Class Name="ViewWindow.ViewWindow" Collapsed="true">
<Position X="0.5" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>CACAAQCAAAEAAAABAAAIgCOAAAAAAAAAIACAADxJACA=</HashCode>
<FileName>ViewWindow.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Font Name="宋体" Size="9" />
</ClassDiagram>

View File

@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
namespace ViewWindow.Config
{
[Serializable]
public class Circle
{
private double _row;
private double _column;
private double _radius;
[XmlElement(ElementName = "Row")]
public double Row
{
get { return this._row; }
set { this._row = value; }
}
[XmlElement(ElementName = "Column")]
public double Column
{
get { return this._column; }
set { this._column = value; }
}
[XmlElement(ElementName = "Radius")]
public double Radius
{
get { return this._radius; }
set { this._radius = value; }
}
private string color = "yellow";
[XmlElement(ElementName = "Color")]
public string Color
{
get { return this.color; }
set { this.color = value; }
}
public Circle()
{
}
public Circle(double row, double column, double radius)
{
this._row = row;
this._column = column;
this._radius = radius;
}
}
}

View File

@@ -0,0 +1,71 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
namespace ViewROI.Config
{
[Serializable]
class CircularArc
{
private double _row;
private double _column;
private double _radius;
private double _startPhi;
private double _extentPhi;
[XmlElement(ElementName = "Row")]
public double Row
{
get { return this._row; }
set { this._row = value; }
}
[XmlElement(ElementName = "Column")]
public double Column
{
get { return this._column; }
set { this._column = value; }
}
[XmlElement(ElementName = "Radius")]
public double Radius
{
get { return this._radius; }
set { this._radius = value; }
}
[XmlElement(ElementName = "startPhi")]
public double StartPhi
{
get { return this._startPhi; }
set { this._startPhi = value; }
}
[XmlElement(ElementName = "ExtentPhi")]
public double ExtentPhi
{
get { return this._extentPhi; }
set { this._extentPhi = value; }
}
private string color = "yellow";
[XmlElement(ElementName = "Color")]
public string Color
{
get { return this.color; }
set { this.color = value; }
}
public CircularArc()
{
}
public CircularArc(double row, double column, double radius,double startPhi, double extentPhi)
{
this._row = row;
this._column = column;
this._radius = radius;
this._startPhi = startPhi;
this._extentPhi = extentPhi;
}
}
}

View File

@@ -0,0 +1,36 @@
using HalconDotNet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ViewROI.Config
{
/// <summary>
/// 显示xld和region 带有颜色
/// </summary>
class HObjectWithColor
{
private HObject hObject;
private string color;
public HObjectWithColor(HObject _hbj, string _color)
{
hObject = _hbj;
color = _color;
}
public HObject HObject
{
get { return hObject; }
set { hObject = value; }
}
public string Color
{
get { return color; }
set { color = value; }
}
}
}

View File

@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
namespace ViewWindow.Config
{
[Serializable]
public class Line
{
private double _rowBegin;
private double _columnBegin;
private double _rowEnd;
private double _columnEnd;
[XmlElement(ElementName = "RowBegin")]
public double RowBegin
{
get { return this._rowBegin; }
set { this._rowBegin = value; }
}
[XmlElement(ElementName = "ColumnBegin")]
public double ColumnBegin
{
get { return this._columnBegin; }
set { this._columnBegin = value; }
}
[XmlElement(ElementName = "RowEnd")]
public double RowEnd
{
get { return this._rowEnd; }
set { this._rowEnd = value; }
}
[XmlElement(ElementName = "ColumnEnd")]
public double ColumnEnd
{
get { return this._columnEnd; }
set { this._columnEnd = value; }
}
private string color = "yellow";
[XmlElement(ElementName = "Color")]
public string Color
{
get { return this.color; }
set { this.color = value; }
}
public Line()
{
}
public Line(double rowBegin, double columnBegin, double rowEnd, double columnEnd)
{
this._rowBegin = rowBegin;
this._columnBegin = columnBegin;
this._rowEnd = rowEnd;
this._columnEnd = columnEnd;
}
}
}

View File

@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
namespace ViewWindow.Config
{
[Serializable]
public class Rectangle1
{
private double _row1;
private double _column1;
private double _row2;
private double _column2;
[XmlElement(ElementName = "Row1")]
public double Row1
{
get { return this._row1; }
set { this._row1 = value; }
}
[XmlElement(ElementName = "Column1")]
public double Column1
{
get { return this._column1; }
set { this._column1 = value; }
}
[XmlElement(ElementName = "Row2")]
public double Row2
{
get { return this._row2; }
set { this._row2 = value; }
}
[XmlElement(ElementName = "Column2")]
public double Column2
{
get { return this._column2; }
set { this._column2 = value; }
}
private string color = "yellow";
[XmlElement(ElementName = "Color")]
public string Color
{
get { return this.color; }
set { this.color = value; }
}
public Rectangle1()
{
}
public Rectangle1(double row1, double column1, double row2, double column2)
{
this._row1 = row1;
this._column1 = column1;
this._row2 = row2;
this._column2 = column2;
}
}
}

View File

@@ -0,0 +1,73 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
namespace ViewWindow.Config
{
[Serializable]
public class Rectangle2
{
private double _row;
private double _column;
private double _phi;
private double _lenth1;
private double _lenth2;
[XmlElement(ElementName = "Row")]
public double Row
{
get { return this._row; }
set { this._row = value; }
}
[XmlElement(ElementName = "Column")]
public double Column
{
get { return this._column; }
set { this._column = value; }
}
[XmlElement(ElementName = "Phi")]
public double Phi
{
get { return this._phi; }
set { this._phi = value; }
}
[XmlElement(ElementName = "Lenth1")]
public double Lenth1
{
get { return this._lenth1; }
set { this._lenth1 = value; }
}
[XmlElement(ElementName = "Lenth2")]
public double Lenth2
{
get { return this._lenth2; }
set { this._lenth2 = value; }
}
private string color = "yellow";
[XmlElement(ElementName = "Color")]
public string Color
{
get { return this.color; }
set { this.color = value; }
}
public Rectangle2()
{
}
public Rectangle2(double row, double column, double phi, double lenth1, double lenth2)
{
this._row = row;
this._column = column;
this._phi = phi;
this._lenth1 = lenth1;
this._lenth2 = lenth2;
}
}
}

View File

@@ -0,0 +1,266 @@
using System;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
//using System.Runtime.Serialization.Json;
using System.Runtime.Serialization.Formatters.Soap;
using System.Runtime.Serialization.Formatters.Binary;
namespace ViewWindow.Config
{
public class SerializeHelper
{
public SerializeHelper()
{ }
#region XML序列化
/// <summary>
/// 文件化XML序列化
/// </summary>
/// <param name="obj">对象</param>
/// <param name="filename">文件路径</param>
public static void Save(object obj, string filename)
{
FileStream fs = null;
try
{
fs = new FileStream(filename, FileMode.Create, FileAccess.Write, FileShare.ReadWrite);
XmlSerializer serializer = new XmlSerializer(obj.GetType());
serializer.Serialize(fs, obj);
}
catch (Exception ex)
{
throw ex;
}
finally
{
if (fs != null) fs.Close();
}
}
/// <summary>
/// 文件化XML反序列化
/// </summary>
/// <param name="type">对象类型</param>
/// <param name="filename">文件路径</param>
public static object Load(Type type, string filename)
{
FileStream fs = null;
try
{
fs = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
XmlSerializer serializer = new XmlSerializer(type);
return serializer.Deserialize(fs);
}
catch (Exception ex)
{
throw ex;
}
finally
{
if (fs != null) fs.Close();
}
}
/// <summary>
/// 文本化XML序列化
/// </summary>
/// <param name="item">对象</param>
public string ToXml<T>(T item)
{
XmlSerializer serializer = new XmlSerializer(item.GetType());
StringBuilder sb = new StringBuilder();
using (XmlWriter writer = XmlWriter.Create(sb))
{
serializer.Serialize(writer, item);
return sb.ToString();
}
}
/// <summary>
/// 文本化XML反序列化
/// </summary>
/// <param name="str">字符串序列</param>
public T FromXml<T>(string str)
{
XmlSerializer serializer = new XmlSerializer(typeof(T));
using (XmlReader reader = new XmlTextReader(new StringReader(str)))
{
return (T)serializer.Deserialize(reader);
}
}
#endregion
#region Json序列化
/// <summary>
/// JsonSerializer序列化
/// </summary>
/// <param name="item">对象</param>
//public string ToJson<T>(T item)
//{
// DataContractJsonSerializer serializer = new DataContractJsonSerializer(item.GetType());
// using (MemoryStream ms = new MemoryStream())
// {
// serializer.WriteObject(ms, item);
// return Encoding.UTF8.GetString(ms.ToArray());
// }
//}
///// <summary>
///// JsonSerializer反序列化
///// </summary>
///// <param name="str">字符串序列</param>
//public T FromJson<T>(string str) where T : class
//{
// DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(T));
// using (MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(str)))
// {
// return serializer.ReadObject(ms) as T;
// }
//}
#endregion
#region SoapFormatter序列化
/// <summary>
/// SoapFormatter序列化
/// </summary>
/// <param name="item">对象</param>
public string ToSoap<T>(T item)
{
SoapFormatter formatter = new SoapFormatter();
using (MemoryStream ms = new MemoryStream())
{
formatter.Serialize(ms, item);
ms.Position = 0;
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(ms);
return xmlDoc.InnerXml;
}
}
/// <summary>
/// SoapFormatter反序列化
/// </summary>
/// <param name="str">字符串序列</param>
public T FromSoap<T>(string str)
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(str);
SoapFormatter formatter = new SoapFormatter();
using (MemoryStream ms = new MemoryStream())
{
xmlDoc.Save(ms);
ms.Position = 0;
return (T)formatter.Deserialize(ms);
}
}
#endregion
#region BinaryFormatter序列化
/// <summary>
/// BinaryFormatter序列化
/// </summary>
/// <param name="item">对象</param>
public string ToBinary<T>(T item)
{
BinaryFormatter formatter = new BinaryFormatter();
using (MemoryStream ms = new MemoryStream())
{
formatter.Serialize(ms, item);
ms.Position = 0;
byte[] bytes = ms.ToArray();
StringBuilder sb = new StringBuilder();
foreach (byte bt in bytes)
{
sb.Append(string.Format("{0:X2}", bt));
}
return sb.ToString();
}
}
/// <summary>
/// BinaryFormatter反序列化
/// </summary>
/// <param name="str">字符串序列</param>
public T FromBinary<T>(string str)
{
int intLen = str.Length / 2;
byte[] bytes = new byte[intLen];
for (int i = 0; i < intLen; i++)
{
int ibyte = Convert.ToInt32(str.Substring(i * 2, 2), 16);
bytes[i] = (byte)ibyte;
}
BinaryFormatter formatter = new BinaryFormatter();
using (MemoryStream ms = new MemoryStream(bytes))
{
return (T)formatter.Deserialize(ms);
}
}
#endregion
/// <summary>
/// 获取对象序列化的二进制版本
/// </summary>
/// <param name="pObj">对象实体</param>
/// <returns>如果对象实体为Null则返回结果为Null。</returns>
public static byte[] GetBytes(object pObj)
{
if (pObj == null) { return null; }
MemoryStream serializationStream = new MemoryStream();
new BinaryFormatter().Serialize(serializationStream, pObj);
serializationStream.Position = 0L;
byte[] buffer = new byte[serializationStream.Length];
serializationStream.Read(buffer, 0, buffer.Length);
serializationStream.Close();
return buffer;
}
/// <summary>
/// 获取对象序列化的XmlDocument版本
/// </summary>
/// <param name="pObj">对象实体</param>
/// <returns>如果对象实体为Null则返回结果为Null。</returns>
public static XmlDocument GetXmlDoc(object pObj)
{
if (pObj == null) { return null; }
XmlSerializer serializer = new XmlSerializer(pObj.GetType());
StringBuilder sb = new StringBuilder();
StringWriter writer = new StringWriter(sb);
serializer.Serialize((TextWriter)writer, pObj);
XmlDocument document = new XmlDocument();
document.LoadXml(sb.ToString());
writer.Close();
return document;
}
/// <summary>
/// 从已序列化数据中(byte[])获取对象实体
/// </summary>
/// <typeparam name="T">要返回的数据类型</typeparam>
/// <param name="binData">二进制数据</param>
/// <returns>对象实体</returns>
public static T GetObject<T>(byte[] binData)
{
if (binData == null) { return default(T); }
BinaryFormatter formatter = new BinaryFormatter();
MemoryStream serializationStream = new MemoryStream(binData);
return (T)formatter.Deserialize(serializationStream);
}
/// <summary>
/// 从已序列化数据(XmlDocument)中获取对象实体
/// </summary>
/// <typeparam name="T">要返回的数据类型</typeparam>
/// <param name="xmlDoc">已序列化的文档对象</param>
/// <returns>对象实体</returns>
public static T GetObject<T>(XmlDocument xmlDoc)
{
if (xmlDoc == null) { return default(T); }
XmlNodeReader xmlReader = new XmlNodeReader(xmlDoc.DocumentElement);
XmlSerializer serializer = new XmlSerializer(typeof(T));
return (T)serializer.Deserialize(xmlReader);
}
}
}

View File

@@ -0,0 +1,458 @@
// 版权所有(C) ChoiceTech Corporation。保留所有权利。
// 此代码的发布遵从
// ChoiceTech 公共许可(HY-PLhttp://choicetech.cn/hy-pl.html)的条款。
//
//版权所有(C) ChoiceTech Corporation。保留所有权利。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using HalconDotNet;
namespace ChoiceTech.Halcon.Control
{
/// <summary>
/// halcon鼠标缩放控件
///
/// 描述:
/// 1, 必须首先通过this.HobjectToHimage(HObject hobject)传入图片,此图片称为"背景图"
/// 2, 有了背景图,就可以通过本控件自定义的 this.DispObj(HObject hObj)显示HObject,类似原方法
/// 3,默认显示红色,DispObj(HObject hObj,string color)可显示其他颜色
/// </summary>
public partial class HWindow_Final : UserControl
{
#region .
private HWindow /**/ hv_window; //halcon窗体控件的句柄 this.mCtrl_HWindow.HalconWindow;
private ContextMenuStrip /**/ hv_MenuStrip; //右键菜单控件
// 窗体控件右键菜单内容
ToolStripMenuItem fit_strip;
ToolStripMenuItem saveImg_strip;
ToolStripMenuItem saveWindow_strip;
ToolStripMenuItem barVisible_strip;
ToolStripMenuItem histogram_strip;
private HImage /**/ hv_image; //缩放时操作的图片 此处千万不要使用hv_image = new HImage(),不然在生成控件dll的时候,会导致无法序列化,去你妈隔壁,还好老子有版本控制,不然都找不到这种恶心问题
private int /**/ hv_imageWidth, hv_imageHeight; //图片宽,高
private string /**/ str_imgSize; //图片尺寸大小 5120X3840
private HTuple str_channel; //通道数
private bool /**/ drawModel = false; //绘制模式下,不允许缩放和鼠标右键菜单
public ViewWindow.ViewWindow viewWindow; /**/ //ViewWindow
public HWindowControl hWindowControl; /**/ // 当前halcon窗口
#endregion
/// <summary>
/// 初始化控件
/// </summary>
public HWindow_Final()
{
InitializeComponent();
//
viewWindow = new ViewWindow.ViewWindow(mCtrl_HWindow);
hWindowControl = this.mCtrl_HWindow;
hv_window = this.mCtrl_HWindow.HalconWindow;
// 设定鼠标按下时图标的形状
// 'arrow' 'default' 'crosshair' 'text I-beam' 'Slashed circle' 'Size All'
// 'Size NESW' 'Size S' 'Size NWSE' 'Size WE' 'Vertical Arrow' 'Hourglass'
//
// hv_window.SetMshape("Hourglass");
fit_strip = new ToolStripMenuItem("适应窗口");
fit_strip.Click += new EventHandler((s, e) => DispImageFit(mCtrl_HWindow));
barVisible_strip = new ToolStripMenuItem("显示StatusBar");
barVisible_strip.CheckOnClick = true;
barVisible_strip.CheckedChanged += new EventHandler(barVisible_strip_CheckedChanged);
m_CtrlHStatusLabelCtrl.Visible = false;
mCtrl_HWindow.Height = this.Height;
saveImg_strip = new ToolStripMenuItem("保存原始图像");
saveImg_strip.Click += new EventHandler((s, e) => SaveImage());
saveWindow_strip = new ToolStripMenuItem("保存窗口缩略图");
saveWindow_strip.Click += new EventHandler((s, e) => SaveWindowDump());
histogram_strip = new ToolStripMenuItem("显示直方图(H)");
histogram_strip.CheckOnClick = true;
histogram_strip.Checked = false;
hv_MenuStrip = new ContextMenuStrip();
hv_MenuStrip.Items.Add(fit_strip);
hv_MenuStrip.Items.Add(barVisible_strip);
hv_MenuStrip.Items.Add(new ToolStripSeparator());
hv_MenuStrip.Items.Add(saveImg_strip);
hv_MenuStrip.Items.Add(saveWindow_strip);
barVisible_strip.Enabled = true;
fit_strip.Enabled = false;
histogram_strip.Enabled = false;
saveImg_strip.Enabled = false;
saveWindow_strip.Enabled = false;
mCtrl_HWindow.ContextMenuStrip = hv_MenuStrip;
mCtrl_HWindow.SizeChanged += new EventHandler((s, e) => DispImageFit(mCtrl_HWindow));
}
/// <summary>
/// 绘制模式下,不允许缩放和鼠标右键菜单
/// </summary>
public bool DrawModel
{
get { return drawModel; }
set
{
//缩放控制
viewWindow.setDrawModel(value);
//绘制模式 不现实右键
if (value == true)
{
mCtrl_HWindow.ContextMenuStrip = null;
}
else
{
//恢复
mCtrl_HWindow.ContextMenuStrip = hv_MenuStrip;
}
drawModel = value;
}
}
private bool _EditModel = true;//绘制的图形是否可以编辑
public bool EditModel
{
get
{
return _EditModel;
}
set
{
viewWindow.setEditModel(value);
_EditModel = value;
}
}
/// <summary>
/// 设置image,初始化控件参数
/// </summary>
public HImage Image
{
get {
return this.hv_image;
}
set
{
if (value != null)
{
if (this.hv_image != null)
{
this.hv_image.Dispose();
}
this.hv_image = value;
hv_image.GetImageSize(out hv_imageWidth, out hv_imageHeight);
HOperatorSet.CountChannels(hv_image ,out str_channel );
str_imgSize = String.Format("{0}X{1}", hv_imageWidth, hv_imageHeight);
str_channel = string.Format("C{0}",str_channel );
//DispImageFit(mCtrl_HWindow);
try
{
barVisible_strip.Enabled = true;
fit_strip.Enabled = true;
histogram_strip.Enabled = true;
saveImg_strip.Enabled = true;
saveWindow_strip.Enabled = true;
}
catch (Exception)
{
}
viewWindow.displayImage(hv_image);
}
}
}
/// <summary>
/// 获得halcon窗体控件的句柄
/// </summary>
public IntPtr HWindowHalconID
{
get { return this.mCtrl_HWindow.HalconID; }
}
public HWindowControl getHWindowControl()
{
return this.mCtrl_HWindow;
}
/// <summary>
/// 状态条 显示/隐藏 CheckedChanged事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void barVisible_strip_CheckedChanged(object sender, EventArgs e)
{
ToolStripMenuItem strip = sender as ToolStripMenuItem;
this.SuspendLayout();
if (strip.Checked)
{
m_CtrlHStatusLabelCtrl.Visible = true;
//mCtrl_HWindow.Height = this.Height - m_CtrlHStatusLabelCtrl.Height - m_CtrlHStatusLabelCtrl.Margin.Top - m_CtrlHStatusLabelCtrl.Margin.Bottom;
mCtrl_HWindow.HMouseMove += HWindowControl_HMouseMove;
}
else
{
m_CtrlHStatusLabelCtrl.Visible = false;
//mCtrl_HWindow.Height = this.Height;
mCtrl_HWindow.HMouseMove -= HWindowControl_HMouseMove;
}
//DispImageFit(mCtrl_HWindow);
this.ResumeLayout(false);
this.PerformLayout();
}
public void showStatusBar()
{
barVisible_strip.Checked = true;
}
/// <summary>
/// 保存窗体截图到本地
/// </summary>
private void SaveWindowDump()
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "PNG图像|*.png|所有文件|*.*";
if (sfd.ShowDialog() == DialogResult.OK)
{
if (String.IsNullOrEmpty(sfd.FileName))
return;
//截取窗口图
HOperatorSet.DumpWindow(HWindowHalconID, "png best", sfd.FileName);
}
}
/// <summary>
/// 保存原始图片到本地
/// </summary>
private void SaveImage()
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "BMP图像|*.bmp|所有文件|*.*";
if (sfd.ShowDialog() == DialogResult.OK)
{
if (String.IsNullOrEmpty(sfd.FileName))
{
return;
}
HOperatorSet.WriteImage(hv_image, "bmp", 0, sfd.FileName);
}
}
/// <summary>
/// 图片适应大小显示在窗体
/// </summary>
/// <param name="hw_Ctrl">halcon窗体控件</param>
private void DispImageFit(HWindowControl hw_Ctrl)
{
try
{
this.viewWindow.resetWindowImage();
}
catch (Exception)
{
}
}
/// <summary>
/// 鼠标在空间窗体里滑动,显示鼠标所在位置的灰度值
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void HWindowControl_HMouseMove(object sender, HMouseEventArgs e)
{
if (hv_image != null)
{
try
{
int button_state;
double positionX, positionY;
string str_value;
string str_position;
bool _isXOut = true, _isYOut = true;
HTuple channel_count;
HOperatorSet.CountChannels(hv_image, out channel_count);
hv_window.GetMpositionSubPix(out positionY, out positionX, out button_state);
str_position = String.Format("R: {0:0000.0}, C: {1:0000.0}", positionY, positionX);
_isXOut = (positionX < 0 || positionX >= hv_imageWidth);
_isYOut = (positionY < 0 || positionY >= hv_imageHeight);
if (!_isXOut && !_isYOut)
{
if ((int)channel_count == 1)
{
int grayVal;
grayVal = hv_image.GetGrayval((int)positionY, (int)positionX);
str_value = String.Format("V: {0:000}", grayVal);
}
else if ((int)channel_count == 3)
{
double grayValRed, grayValGreen, grayValBlue;
HImage _RedChannel, _GreenChannel, _BlueChannel;
_RedChannel = hv_image.AccessChannel(1);
_GreenChannel = hv_image.AccessChannel(2);
_BlueChannel = hv_image.AccessChannel(3);
grayValRed = _RedChannel.GetGrayval((int)positionY, (int)positionX);
grayValGreen = _GreenChannel.GetGrayval((int)positionY, (int)positionX);
grayValBlue = _BlueChannel.GetGrayval((int)positionY, (int)positionX);
_RedChannel.Dispose();
_GreenChannel.Dispose();
_BlueChannel.Dispose();
str_value = String.Format("V: ({0:000.0}, {1:000.0}, {2:000.0})", grayValRed, grayValGreen, grayValBlue);
}
else
{
str_value = "";
}
m_CtrlHStatusLabelCtrl.Text = str_channel +" "+str_imgSize + " " + str_position + " " + str_value;
}
}
catch (Exception ex)
{
//不处理
}
}
}
public void ClearWindow()
{
try
{
this.Invoke(new Action(
() =>
{
//this.hv_image = null;
m_CtrlHStatusLabelCtrl.Visible = false;
barVisible_strip.Enabled = false;
fit_strip.Enabled = false;
histogram_strip.Enabled = false;
saveImg_strip.Enabled = false;
saveWindow_strip.Enabled = false;
mCtrl_HWindow.HalconWindow.ClearWindow();
viewWindow.ClearWindow();
}
));
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
/// <summary>
/// Hobject转换为的临时Himage,显示背景图
/// </summary>
/// <param name="hobject">传递Hobject,必须为图像</param>
public void HobjectToHimage(HObject hobject)
{
if (hobject == null || !hobject.IsInitialized())
{
ClearWindow();
return;
}
this.Image = new HImage(hobject);
}
#region ,HObject
/// <summary>
/// 默认红颜色显示
/// </summary>
/// <param name="hObj">传入的region.xld,image</param>
public void DispObj(HObject hObj)
{
lock (this)
{
viewWindow.displayHobject(hObj, null);
}
}
/// <summary>
/// 重新开辟内存保存 防止被传入的HObject在其他地方dispose后,不能重现
/// </summary>
/// <param name="hObj">传入的region.xld,image</param>
/// <param name="color">颜色</param>
public void DispObj(HObject hObj, string color)
{
lock (this)
{
viewWindow.displayHobject(hObj, color);
}
}
#endregion
/// <summary>
/// 鼠标离开事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void mCtrl_HWindow_MouseLeave(object sender, EventArgs e)
{
//避免鼠标离开窗口,再返回的时候,图表随着鼠标移动
viewWindow.mouseleave();
}
}
}

105
ImageWindow/HWindow_Final.designer.cs generated Normal file
View File

@@ -0,0 +1,105 @@
namespace ChoiceTech.Halcon.Control
{
partial class HWindow_Final
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
hv_MenuStrip.Dispose();
mCtrl_HWindow.HMouseMove -= HWindowControl_HMouseMove;
}
if (disposing && hv_image != null)
{
hv_image.Dispose();
}
if (disposing && hv_window != null)
{
hv_window.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HWindow_Final));
this.m_CtrlHStatusLabelCtrl = new System.Windows.Forms.Label();
this.m_CtrlImageList = new System.Windows.Forms.ImageList(this.components);
this.mCtrl_HWindow = new HalconDotNet.HWindowControl();
this.SuspendLayout();
//
// m_CtrlHStatusLabelCtrl
//
this.m_CtrlHStatusLabelCtrl.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.m_CtrlHStatusLabelCtrl.AutoSize = true;
this.m_CtrlHStatusLabelCtrl.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.m_CtrlHStatusLabelCtrl.ForeColor = System.Drawing.SystemColors.WindowText;
this.m_CtrlHStatusLabelCtrl.Location = new System.Drawing.Point(3, 498);
this.m_CtrlHStatusLabelCtrl.Margin = new System.Windows.Forms.Padding(3);
this.m_CtrlHStatusLabelCtrl.Name = "m_CtrlHStatusLabelCtrl";
this.m_CtrlHStatusLabelCtrl.Size = new System.Drawing.Size(0, 17);
this.m_CtrlHStatusLabelCtrl.TabIndex = 1;
//
// m_CtrlImageList
//
this.m_CtrlImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("m_CtrlImageList.ImageStream")));
this.m_CtrlImageList.TransparentColor = System.Drawing.Color.Transparent;
this.m_CtrlImageList.Images.SetKeyName(0, "TableIcon.png");
this.m_CtrlImageList.Images.SetKeyName(1, "PicturesIcon.png");
//
// mCtrl_HWindow
//
this.mCtrl_HWindow.BackColor = System.Drawing.Color.Black;
this.mCtrl_HWindow.BorderColor = System.Drawing.Color.Black;
this.mCtrl_HWindow.Cursor = System.Windows.Forms.Cursors.Default;
this.mCtrl_HWindow.Dock = System.Windows.Forms.DockStyle.Fill;
this.mCtrl_HWindow.ImagePart = new System.Drawing.Rectangle(0, 0, 640, 480);
this.mCtrl_HWindow.Location = new System.Drawing.Point(0, 0);
this.mCtrl_HWindow.Margin = new System.Windows.Forms.Padding(0);
this.mCtrl_HWindow.Name = "mCtrl_HWindow";
this.mCtrl_HWindow.Size = new System.Drawing.Size(562, 518);
this.mCtrl_HWindow.TabIndex = 0;
this.mCtrl_HWindow.WindowSize = new System.Drawing.Size(562, 518);
this.mCtrl_HWindow.HMouseMove += new HalconDotNet.HMouseEventHandler(this.HWindowControl_HMouseMove);
this.mCtrl_HWindow.MouseLeave += new System.EventHandler(this.mCtrl_HWindow_MouseLeave);
//
// HWindow_Final
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Transparent;
this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.Controls.Add(this.m_CtrlHStatusLabelCtrl);
this.Controls.Add(this.mCtrl_HWindow);
this.Name = "HWindow_Final";
this.Size = new System.Drawing.Size(562, 518);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label m_CtrlHStatusLabelCtrl;
private System.Windows.Forms.ImageList m_CtrlImageList;
private HalconDotNet.HWindowControl mCtrl_HWindow;
}
}

View File

@@ -0,0 +1,172 @@
<?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:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="m_CtrlImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="m_CtrlImageList.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADk
CAAAAk1TRnQBSQFMAgEBAgEAAbABAAGwAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm
AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM
AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA
ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz
AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ
AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM
AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA
AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA
AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ
AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/
AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA
AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm
ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ
Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz
AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA
AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM
AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM
ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM
Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA
AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM
AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ
AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz
AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm
AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw
AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/4IAAbwB9wPvAZID7wHt
A+8B6gIAAQcB6wpyAesBFSIAAbwB8wL/AfQB8QP/AQcD/wHqAgABBwyYAREiAAG8AfMC/wH0AfED/wEH
A/8B6gIAAQcGmAF4AZgCmQKYAREiAAG8AQcD8AG8A/ABBwPwAeoCAAEHAfACeAKYAXgBCAH2BP8BFSIA
AbwB8gL0AfMB8QL0Af8BBwH/AfQB/wHqAgABBwH/AfMDCAHzBv8BFCIAAbwB8wL/AfQB8QP/AQcD/wHq
AgABBwf/AcMBWQGaAv8BFCIAAbwB8gL0AfMB8QL0Af8BBwH/AfQB/wHqAgABBwf/AZoB/wHDAZoB/wEU
IgABvAEHA/ABvAPwAQcD8AHqAgABBwb/AfYBGgH/AfYBegH/ARQiAAG8AfMC/wH0AfED/wEHA/8B6gIA
AQcH/wEaApoBwwH/ARQiAAG8AfMC/wH0AfED/wEHA/8B6gIAAQcM/wEUIgABvAH3A+8BkgPvAe0D7wHq
AgABBwz3ARThAAFCAU0BPgcAAT4DAAEoAwABQAMAARADAAEBAQABAQUAAYAXAAP/AQAE/wQABP8EAAGA
AQEBgAEBBAABgAEBAYABAQQAAYABAQGAAQEEAAGAAQEBgAEBBAABgAEBAYABAQQAAYABAQGAAQEEAAGA
AQEBgAEBBAABgAEBAYABAQQAAYABAQGAAQEEAAGAAQEBgAEBBAABgAEBAYABAQQABP8EAAT/BAAE/wQA
Cw==
</value>
</data>
<metadata name="mCtrl_HWindow.LayoutBitmap" type="System.Resources.ResXNullRef, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value />
</metadata>
</root>

View File

@@ -0,0 +1,32 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HWindow_Tool", "HWindow_Tool.csproj", "{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}.Debug|x64.ActiveCfg = Debug|x64
{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}.Debug|x64.Build.0 = Debug|x64
{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}.Debug|x86.ActiveCfg = Debug|x86
{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}.Debug|x86.Build.0 = Debug|x86
{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}.Release|Any CPU.Build.0 = Release|Any CPU
{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}.Release|x64.ActiveCfg = Release|x64
{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}.Release|x64.Build.0 = Release|x64
{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}.Release|x86.ActiveCfg = Release|x86
{9BAA53FD-89B5-43E2-AC59-A27B006DEBB6}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,415 @@
using System;
using System.Collections;
using HalconDotNet;
namespace ViewWindow.Model
{
public delegate void GCDelegate(string val);
/// <summary>
/// This class contains the graphical context of an HALCON object. The
/// set of graphical modes is defined by the hashlist 'graphicalSettings'.
/// If the list is empty, then there is no difference to the graphical
/// setting defined by the system by default. Otherwise, the provided
/// HALCON window is adjusted according to the entries of the supplied
/// graphical context (when calling applyContext())
/// </summary>
public class GraphicsContext
{
/// <summary>
/// Graphical mode for the output color (see dev_set_color)
/// </summary>
public const string GC_COLOR = "Color";
/// <summary>
/// Graphical mode for the multi-color output (see dev_set_colored)
/// </summary>
public const string GC_COLORED = "Colored";
/// <summary>
/// Graphical mode for the line width (see set_line_width)
/// </summary>
public const string GC_LINEWIDTH = "LineWidth";
/// <summary>
/// Graphical mode for the drawing (see set_draw)
/// </summary>
public const string GC_DRAWMODE = "DrawMode";
/// <summary>
/// Graphical mode for the drawing shape (see set_shape)
/// </summary>
public const string GC_SHAPE = "Shape";
/// <summary>
/// Graphical mode for the LUT (lookup table) (see set_lut)
/// </summary>
public const string GC_LUT = "Lut";
/// <summary>
/// Graphical mode for the painting (see set_paint)
/// </summary>
public const string GC_PAINT = "Paint";
/// <summary>
/// Graphical mode for the line style (see set_line_style)
/// </summary>
public const string GC_LINESTYLE = "LineStyle";
/// <summary>
/// Hashlist containing entries for graphical modes (defined by GC_*),
/// which is then linked to some HALCON object to describe its
/// graphical context.
/// </summary>
private Hashtable graphicalSettings;
/// <summary>
/// Backup of the last graphical context applied to the window.
/// </summary>
public Hashtable stateOfSettings;
private IEnumerator iterator;
/// <summary>
/// Option to delegate messages from the graphical context
/// to some observer class
/// </summary>
public GCDelegate gcNotification;
/// <summary>
/// Creates a graphical context with no initial
/// graphical modes
/// </summary>
public GraphicsContext()
{
graphicalSettings = new Hashtable(10, 0.2f);
gcNotification = new GCDelegate(dummy);
stateOfSettings = new Hashtable(10, 0.2f);
}
/// <summary>
/// Creates an instance of the graphical context with
/// the modes defined in the hashtable 'settings'
/// </summary>
/// <param name="settings">
/// List of modes, which describes the graphical context
/// </param>
public GraphicsContext(Hashtable settings)
{
graphicalSettings = settings;
gcNotification = new GCDelegate(dummy);
stateOfSettings = new Hashtable(10, 0.2f);
}
/// <summary>Applies graphical context to the HALCON window</summary>
/// <param name="window">Active HALCON window</param>
/// <param name="cContext">
/// List that contains graphical modes for window
/// </param>
public void applyContext(HWindow window, Hashtable cContext)
{
string key = "";
string valS = "";
int valI = -1;
HTuple valH = null;
iterator = cContext.Keys.GetEnumerator();
try
{
while (iterator.MoveNext())
{
key = (string)iterator.Current;
if (stateOfSettings.Contains(key) &&
stateOfSettings[key] == cContext[key])
continue;
switch (key)
{
case GC_COLOR:
valS = (string)cContext[key];
window.SetColor(valS);
if (stateOfSettings.Contains(GC_COLORED))
stateOfSettings.Remove(GC_COLORED);
break;
case GC_COLORED:
valI = (int)cContext[key];
window.SetColored(valI);
if (stateOfSettings.Contains(GC_COLOR))
stateOfSettings.Remove(GC_COLOR);
break;
case GC_DRAWMODE:
valS = (string)cContext[key];
window.SetDraw(valS);
break;
case GC_LINEWIDTH:
valI = (int)cContext[key];
window.SetLineWidth(valI);
break;
case GC_LUT:
valS = (string)cContext[key];
window.SetLut(valS);
break;
case GC_PAINT:
valS = (string)cContext[key];
window.SetPaint(valS);
break;
case GC_SHAPE:
valS = (string)cContext[key];
window.SetShape(valS);
break;
case GC_LINESTYLE:
valH = (HTuple)cContext[key];
window.SetLineStyle(valH);
break;
default:
break;
}
if (valI != -1)
{
if (stateOfSettings.Contains(key))
stateOfSettings[key] = valI;
else
stateOfSettings.Add(key, valI);
valI = -1;
}
else if (valS != "")
{
if (stateOfSettings.Contains(key))
stateOfSettings[key] = valI;
else
stateOfSettings.Add(key, valI);
valS = "";
}
else if (valH != null)
{
if (stateOfSettings.Contains(key))
stateOfSettings[key] = valI;
else
stateOfSettings.Add(key, valI);
valH = null;
}
}//while
}
catch (HOperatorException e)
{
gcNotification(e.Message);
return;
}
}
/// <summary>Sets a value for the graphical mode GC_COLOR</summary>
/// <param name="val">
/// A single color, e.g. "blue", "green" ...etc.
/// </param>
public void setColorAttribute(string val)
{
if (graphicalSettings.ContainsKey(GC_COLORED))
graphicalSettings.Remove(GC_COLORED);
addValue(GC_COLOR, val);
}
/// <summary>Sets a value for the graphical mode GC_COLORED</summary>
/// <param name="val">
/// The colored mode, which can be either "colored3" or "colored6"
/// or "colored12"
/// </param>
public void setColoredAttribute(int val)
{
if (graphicalSettings.ContainsKey(GC_COLOR))
graphicalSettings.Remove(GC_COLOR);
addValue(GC_COLORED, val);
}
/// <summary>Sets a value for the graphical mode GC_DRAWMODE</summary>
/// <param name="val">
/// One of the possible draw modes: "margin" or "fill"
/// </param>
public void setDrawModeAttribute(string val)
{
addValue(GC_DRAWMODE, val);
}
/// <summary>Sets a value for the graphical mode GC_LINEWIDTH</summary>
/// <param name="val">
/// The line width, which can range from 1 to 50
/// </param>
public void setLineWidthAttribute(int val)
{
addValue(GC_LINEWIDTH, val);
}
/// <summary>Sets a value for the graphical mode GC_LUT</summary>
/// <param name="val">
/// One of the possible modes of look up tables. For
/// further information on particular setups, please refer to the
/// Reference Manual entry of the operator set_lut.
/// </param>
public void setLutAttribute(string val)
{
addValue(GC_LUT, val);
}
/// <summary>Sets a value for the graphical mode GC_PAINT</summary>
/// <param name="val">
/// One of the possible paint modes. For further
/// information on particular setups, please refer refer to the
/// Reference Manual entry of the operator set_paint.
/// </param>
public void setPaintAttribute(string val)
{
addValue(GC_PAINT, val);
}
/// <summary>Sets a value for the graphical mode GC_SHAPE</summary>
/// <param name="val">
/// One of the possible shape modes. For further
/// information on particular setups, please refer refer to the
/// Reference Manual entry of the operator set_shape.
/// </param>
public void setShapeAttribute(string val)
{
addValue(GC_SHAPE, val);
}
/// <summary>Sets a value for the graphical mode GC_LINESTYLE</summary>
/// <param name="val">
/// A line style mode, which works
/// identical to the input for the HDevelop operator
/// 'set_line_style'. For particular information on this
/// topic, please refer to the Reference Manual entry of the operator
/// set_line_style.
/// </param>
public void setLineStyleAttribute(HTuple val)
{
addValue(GC_LINESTYLE, val);
}
/// <summary>
/// Adds a value to the hashlist 'graphicalSettings' for the
/// graphical mode described by the parameter 'key'
/// </summary>
/// <param name="key">
/// A graphical mode defined by the constant GC_*
/// </param>
/// <param name="val">
/// Defines the value as an int for this graphical
/// mode 'key'
/// </param>
private void addValue(string key, int val)
{
if (graphicalSettings.ContainsKey(key))
graphicalSettings[key] = val;
else
graphicalSettings.Add(key, val);
}
/// <summary>
/// Adds a value to the hashlist 'graphicalSettings' for the
/// graphical mode, described by the parameter 'key'
/// </summary>
/// <param name="key">
/// A graphical mode defined by the constant GC_*
/// </param>
/// <param name="val">
/// Defines the value as a string for this
/// graphical mode 'key'
/// </param>
private void addValue(string key, string val)
{
if (graphicalSettings.ContainsKey(key))
graphicalSettings[key] = val;
else
graphicalSettings.Add(key, val);
}
/// <summary>
/// Adds a value to the hashlist 'graphicalSettings' for the
/// graphical mode, described by the parameter 'key'
/// </summary>
/// <param name="key">
/// A graphical mode defined by the constant GC_*
/// </param>
/// <param name="val">
/// Defines the value as a HTuple for this
/// graphical mode 'key'
/// </param>
private void addValue(string key, HTuple val)
{
if (graphicalSettings.ContainsKey(key))
graphicalSettings[key] = val;
else
graphicalSettings.Add(key, val);
}
/// <summary>
/// Clears the list of graphical settings.
/// There will be no graphical changes made prior
/// before drawing objects, since there are no
/// graphical entries to be applied to the window.
/// </summary>
public void clear()
{
graphicalSettings.Clear();
}
/// <summary>
/// Returns an exact clone of this graphicsContext instance
/// </summary>
public GraphicsContext copy()
{
return new GraphicsContext((Hashtable)this.graphicalSettings.Clone());
}
/// <summary>
/// If the hashtable contains the key, the corresponding
/// hashtable value is returned
/// </summary>
/// <param name="key">
/// One of the graphical keys starting with GC_*
/// </param>
public object getGraphicsAttribute(string key)
{
if (graphicalSettings.ContainsKey(key))
return graphicalSettings[key];
return null;
}
/// <summary>
/// Returns a copy of the hashtable that carries the
/// entries for the current graphical context
/// </summary>
/// <returns> current graphical context </returns>
public Hashtable copyContextList()
{
return (Hashtable)graphicalSettings.Clone();
}
/********************************************************************/
public void dummy(string val) { }
}//end of class
}//end of namespace

View File

@@ -0,0 +1,51 @@
using System;
using HalconDotNet;
using System.Collections;
namespace ViewWindow.Model
{
/// <summary>
/// This class is an auxiliary class, which is used to
/// link a graphical context to an HALCON object. The graphical
/// context is described by a hashtable, which contains a list of
/// graphical modes (e.g GC_COLOR, GC_LINEWIDTH and GC_PAINT)
/// and their corresponding values (e.g "blue", "4", "3D-plot"). These
/// graphical states are applied to the window before displaying the
/// object.
/// </summary>
public class HObjectEntry
{
/// <summary>Hashlist defining the graphical context for HObj</summary>
public Hashtable gContext;
/// <summary>HALCON object</summary>
public HObject HObj;
/// <summary>Constructor</summary>
/// <param name="obj">
/// HALCON object that is linked to the graphical context gc.
/// </param>
/// <param name="gc">
/// Hashlist of graphical states that are applied before the object
/// is displayed.
/// </param>
public HObjectEntry(HObject obj, Hashtable gc)
{
gContext = gc;
HObj = obj;
}
/// <summary>
/// Clears the entries of the class members Hobj and gContext
/// </summary>
public void clear()
{
gContext.Clear();
HObj.Dispose();
}
}//end of class
}//end of namespace

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HalconDotNet;
namespace ViewWindow.Model
{
interface IViewWindow
{
void displayImage(HObject img);
void resetWindowImage();
void zoomWindowImage();
void moveWindowImage();
void noneWindowImage();
void genRect1(double row1, double col1, double row2, double col2, ref List<ROI> rois);
void genRect2(double row, double col, double phi, double length1, double length2, ref List<ROI> rois);
void genCircle(double row, double col, double radius, ref List<ROI> rois);
void genCircularArc(double row, double col, double radius,double startPhi, double extentPhi,string direct, ref List<ROI> rois);
void genLine(double beginRow, double beginCol, double endRow, double endCol, ref List<ROI> rois);
List<double> smallestActiveROI(out string name,out int index);
ROI smallestActiveROI(out List<double> data, out int index);
void selectROI(int index);
void selectROI(List<ROI> rois, int index);
void displayROI(List<ROI> rois);
void removeActiveROI(ref List<ROI> rois);
void saveROI(List<ROI> rois, string fileNmae);
void loadROI(string fileName, out List<ROI> rois);
}
}

187
ImageWindow/Model/ROI.cs Normal file
View File

@@ -0,0 +1,187 @@
using System;
using HalconDotNet;
namespace ViewWindow.Model
{
/// <summary>
/// This class is a base class containing virtual methods for handling
/// ROIs. Therefore, an inheriting class needs to define/override these
/// methods to provide the ROIController with the necessary information on
/// its (= the ROIs) shape and position. The example project provides
/// derived ROI shapes for rectangles, lines, circles, and circular arcs.
/// To use other shapes you must derive a new class from the base class
/// ROI and implement its methods.
/// </summary>
[Serializable]
public class ROI
{
private string color = "blue";
public string Color
{
get { return this.color; }
set { this.color = value; }
}
private string _type;
public string Type
{
get
{
return this._type ;
}
set
{
this._type = value;
}
}
// class members of inheriting ROI classes
protected int NumHandles;
protected int activeHandleIdx;
/// <summary>
/// Flag to define the ROI to be 'positive' or 'negative'.
/// </summary>
protected int OperatorFlag;
/// <summary>Parameter to define the line style of the ROI.</summary>
public HTuple flagLineStyle;
/// <summary>Constant for a positive ROI flag.</summary>
public const int POSITIVE_FLAG = ROIController.MODE_ROI_POS;
/// <summary>Constant for a negative ROI flag.</summary>
public const int NEGATIVE_FLAG = ROIController.MODE_ROI_NEG;
public const int ROI_TYPE_LINE = 10;
public const int ROI_TYPE_CIRCLE = 11;
public const int ROI_TYPE_CIRCLEARC = 12;
public const int ROI_TYPE_RECTANCLE1 = 13;
public const int ROI_TYPE_RECTANGLE2 = 14;
protected HTuple posOperation = new HTuple();
protected HTuple negOperation = new HTuple(new int[] { 2, 2 });
/// <summary>Constructor of abstract ROI class.</summary>
public ROI() { }
public virtual void createRectangle1(double row1, double col1, double row2, double col2) { }
public virtual void createRectangle2(double row, double col, double phi, double length1, double length2) { }
public virtual void createCircle(double row,double col,double radius) { }
public virtual void createCircularArc(double row, double col, double radius, double startPhi, double extentPhi, string direct) { }
public virtual void createLine(double beginRow, double beginCol, double endRow, double endCol) { }
/// <summary>Creates a new ROI instance at the mouse position.</summary>
/// <param name="midX">
/// x (=column) coordinate for ROI
/// </param>
/// <param name="midY">
/// y (=row) coordinate for ROI
/// </param>
public virtual void createROI(double midX, double midY) { }
/// <summary>Paints the ROI into the supplied window.</summary>
/// <param name="window">HALCON window</param>
public virtual void draw(HalconDotNet.HWindow window) { }
/// <summary>
/// Returns the distance of the ROI handle being
/// closest to the image point(x,y)
/// </summary>
/// <param name="x">x (=column) coordinate</param>
/// <param name="y">y (=row) coordinate</param>
/// <returns>
/// Distance of the closest ROI handle.
/// </returns>
public virtual double distToClosestHandle(double x, double y)
{
return 0.0;
}
/// <summary>
/// Paints the active handle of the ROI object into the supplied window.
/// </summary>
/// <param name="window">HALCON window</param>
public virtual void displayActive(HalconDotNet.HWindow window) { }
/// <summary>
/// Recalculates the shape of the ROI. Translation is
/// performed at the active handle of the ROI object
/// for the image coordinate (x,y).
/// </summary>
/// <param name="x">x (=column) coordinate</param>
/// <param name="y">y (=row) coordinate</param>
public virtual void moveByHandle(double x, double y) { }
/// <summary>Gets the HALCON region described by the ROI.</summary>
public virtual HRegion getRegion()
{
return null;
}
public virtual double getDistanceFromStartPoint(double row, double col)
{
return 0.0;
}
/// <summary>
/// Gets the model information described by
/// the ROI.
/// </summary>
public virtual HTuple getModelData()
{
return null;
}
/// <summary>Number of handles defined for the ROI.</summary>
/// <returns>Number of handles</returns>
public int getNumHandles()
{
return NumHandles;
}
/// <summary>Gets the active handle of the ROI.</summary>
/// <returns>Index of the active handle (from the handle list)</returns>
public int getActHandleIdx()
{
return activeHandleIdx;
}
/// <summary>
/// Gets the sign of the ROI object, being either
/// 'positive' or 'negative'. This sign is used when creating a model
/// region for matching applications from a list of ROIs.
/// </summary>
public int getOperatorFlag()
{
return OperatorFlag;
}
/// <summary>
/// Sets the sign of a ROI object to be positive or negative.
/// The sign is used when creating a model region for matching
/// applications by summing up all positive and negative ROI models
/// created so far.
/// </summary>
/// <param name="flag">Sign of ROI object</param>
public void setOperatorFlag(int flag)
{
OperatorFlag = flag;
switch (OperatorFlag)
{
case ROI.POSITIVE_FLAG:
flagLineStyle = posOperation;
break;
case ROI.NEGATIVE_FLAG:
flagLineStyle = negOperation;
break;
default:
flagLineStyle = posOperation;
break;
}
}
}//end of class
}//end of namespace

View File

@@ -0,0 +1,193 @@
using System;
using HalconDotNet;
using System.Xml.Serialization;
namespace ViewWindow.Model
{
/// <summary>
/// This class demonstrates one of the possible implementations for a
/// circular ROI. ROICircle inherits from the base class ROI and
/// implements (besides other auxiliary methods) all virtual methods
/// defined in ROI.cs.
/// </summary>
[Serializable]
public class ROICircle : ROI
{
[XmlElement(ElementName = "Row")]
public double Row
{
get { return this.midR; }
set { this.midR = value; }
}
[XmlElement(ElementName = "Column")]
public double Column
{
get { return this.midC; }
set { this.midC = value; }
}
[XmlElement(ElementName = "Radius")]
public double Radius
{
get { return this.radius; }
set { this.radius = value; }
}
private double radius;
private double row1, col1; // first handle
private double midR, midC; // second handle
public ROICircle()
{
NumHandles = 2; // one at corner of circle + midpoint
activeHandleIdx = 1;
}
public ROICircle(double row, double col, double radius)
{
createCircle(row, col, radius);
}
public override void createCircle(double row, double col, double radius)
{
base.createCircle(row, col, radius);
midR = row;
midC = col;
this.radius = radius;
row1 = midR;
col1 = midC + radius;
}
/// <summary>Creates a new ROI instance at the mouse position</summary>
public override void createROI(double midX, double midY)
{
midR = midY;
midC = midX;
radius = 100;
row1 = midR;
col1 = midC + radius;
}
/// <summary>Paints the ROI into the supplied window</summary>
/// <param name="window">HALCON window</param>
public override void draw(HalconDotNet.HWindow window)
{
window.DispCircle(midR, midC, radius);
window.DispRectangle2(row1, col1, 0, 8, 8);
window.DispRectangle2(midR, midC, 0, 8, 8);
}
/// <summary>
/// Returns the distance of the ROI handle being
/// closest to the image point(x,y)
/// </summary>
public override double distToClosestHandle(double x, double y)
{
double max = 10000;
double [] val = new double[NumHandles];
val[0] = HMisc.DistancePp(y, x, row1, col1); // border handle
val[1] = HMisc.DistancePp(y, x, midR, midC); // midpoint
for (int i=0; i < NumHandles; i++)
{
if (val[i] < max)
{
max = val[i];
activeHandleIdx = i;
}
}// end of for
return val[activeHandleIdx];
}
/// <summary>
/// Paints the active handle of the ROI object into the supplied window
/// </summary>
public override void displayActive(HalconDotNet.HWindow window)
{
switch (activeHandleIdx)
{
case 0:
window.DispRectangle2(row1, col1, 0, 8, 8);
break;
case 1:
window.DispRectangle2(midR, midC, 0, 8, 8);
break;
}
}
/// <summary>Gets the HALCON region described by the ROI</summary>
public override HRegion getRegion()
{
HRegion region = new HRegion();
region.GenCircle(midR, midC, radius);
return region;
}
public override double getDistanceFromStartPoint(double row, double col)
{
double sRow = midR; // assumption: we have an angle starting at 0.0
double sCol = midC + 1 * radius;
double angle = HMisc.AngleLl(midR, midC, sRow, sCol, midR, midC, row, col);
if (angle < 0)
angle += 2 * Math.PI;
return (radius * angle);
}
/// <summary>
/// Gets the model information described by
/// the ROI
/// </summary>
public override HTuple getModelData()
{
return new HTuple(new double[] { midR, midC, radius });
}
/// <summary>
/// Recalculates the shape of the ROI. Translation is
/// performed at the active handle of the ROI object
/// for the image coordinate (x,y)
/// </summary>
public override void moveByHandle(double newX, double newY)
{
HTuple distance;
double shiftX,shiftY;
switch (activeHandleIdx)
{
case 0: // handle at circle border
row1 = newY;
col1 = newX;
HOperatorSet.DistancePp(new HTuple(row1), new HTuple(col1),
new HTuple(midR), new HTuple(midC),
out distance);
radius = distance[0].D;
break;
case 1: // midpoint
shiftY = midR - newY;
shiftX = midC - newX;
midR = newY;
midC = newX;
row1 -= shiftY;
col1 -= shiftX;
break;
}
}
}//end of class
}//end of namespace

View File

@@ -0,0 +1,366 @@
using System;
using HalconDotNet;
using System.Xml.Serialization;
namespace ViewWindow.Model
{
/// <summary>
/// This class implements an ROI shaped as a circular
/// arc. ROICircularArc inherits from the base class ROI and
/// implements (besides other auxiliary methods) all virtual methods
/// defined in ROI.cs.
/// </summary>
public class ROICircularArc : ROI
{
public double Row
{
get { return this.midR; }
set { this.midR = value; }
}
[XmlElement(ElementName = "Column")]
public double Column
{
get { return this.midC; }
set { this.midC = value; }
}
[XmlElement(ElementName = "Radius")]
public double Radius
{
get { return this.radius; }
set { this.radius = value; }
}
[XmlElement(ElementName = "StartPhi")]
public double StartPhi
{
get { return this.startPhi; }
set { this.startPhi = value; }
}
[XmlElement(ElementName = "ExtentPhi")]
public double ExtentPhi
{
get { return this.extentPhi; }
set { this.extentPhi = value; }
}
//handles
private double midR, midC; // 0. handle: midpoint
private double sizeR, sizeC; // 1. handle
private double startR, startC; // 2. handle
private double extentR, extentC; // 3. handle
//model data to specify the arc
private double radius;
private double startPhi, extentPhi; // -2*PI <= x <= 2*PI
//display attributes
private HXLDCont contour;
private HXLDCont arrowHandleXLD;
private string circDir;
private double TwoPI;
private double PI;
public ROICircularArc()
{
NumHandles = 4; // midpoint handle + three handles on the arc
activeHandleIdx = 0;
contour = new HXLDCont();
circDir = "";
TwoPI = 2 * Math.PI;
PI = Math.PI;
arrowHandleXLD = new HXLDCont();
arrowHandleXLD.GenEmptyObj();
}
public ROICircularArc(double row, double col, double radius, double startPhi, double extentPhi)
{
createCircularArc(row, col, radius, startPhi, extentPhi, "positive");
}
public override void createCircularArc(double row, double col, double radius, double startPhi, double extentPhi,string direct)
{
base.createCircularArc(row, col, radius, startPhi, extentPhi, direct);
midR = row;
midC = col;
this.radius = radius;
sizeR = midR;
sizeC = midC - radius;
this.startPhi = startPhi;
if (direct == "positive")
{
this.extentPhi = extentPhi;
}
else
{
this.extentPhi = extentPhi;
}
// circDir = "positive";
circDir = direct;
determineArcHandles();
updateArrowHandle();
}
/// <summary>Creates a new ROI instance at the mouse position</summary>
public override void createROI(double midX, double midY)
{
midR = midY;
midC = midX;
radius = 100;
sizeR = midR;
sizeC = midC - radius;
startPhi = PI * 0.25;
extentPhi = PI * 1.5;
circDir = "positive";
determineArcHandles();
updateArrowHandle();
}
/// <summary>Paints the ROI into the supplied window</summary>
/// <param name="window">HALCON window</param>
public override void draw(HalconDotNet.HWindow window)
{
contour.Dispose();
contour.GenCircleContourXld(midR, midC, radius, startPhi,
(startPhi + extentPhi), circDir, 1.0);
window.DispObj(contour);
window.DispRectangle2(sizeR, sizeC, 0, 5, 5);
window.DispRectangle2(midR, midC, 0, 5, 5);
window.DispRectangle2(startR, startC, startPhi, 10, 2);
window.DispObj(arrowHandleXLD);
}
/// <summary>
/// Returns the distance of the ROI handle being
/// closest to the image point(x,y)
/// </summary>
public override double distToClosestHandle(double x, double y)
{
double max = 10000;
double [] val = new double[NumHandles];
val[0] = HMisc.DistancePp(y, x, midR, midC); // midpoint
val[1] = HMisc.DistancePp(y, x, sizeR, sizeC); // border handle
val[2] = HMisc.DistancePp(y, x, startR, startC); // border handle
val[3] = HMisc.DistancePp(y, x, extentR, extentC); // border handle
for (int i=0; i < NumHandles; i++)
{
if (val[i] < max)
{
max = val[i];
activeHandleIdx = i;
}
}// end of for
return val[activeHandleIdx];
}
/// <summary>
/// Paints the active handle of the ROI object into the supplied window
/// </summary>
public override void displayActive(HalconDotNet.HWindow window)
{
switch (activeHandleIdx)
{
case 0:
window.DispRectangle2(midR, midC, 0, 5, 5);
break;
case 1:
window.DispRectangle2(sizeR, sizeC, 0, 5, 5);
break;
case 2:
window.DispRectangle2(startR, startC, startPhi, 10, 2);
break;
case 3:
window.DispObj(arrowHandleXLD);
break;
}
}
/// <summary>
/// Recalculates the shape of the ROI. Translation is
/// performed at the active handle of the ROI object
/// for the image coordinate (x,y)
/// </summary>
public override void moveByHandle(double newX, double newY)
{
HTuple distance;
double dirX, dirY, prior, next, valMax, valMin;
switch (activeHandleIdx)
{
case 0: // midpoint
dirY = midR - newY;
dirX = midC - newX;
midR = newY;
midC = newX;
sizeR -= dirY;
sizeC -= dirX;
determineArcHandles();
break;
case 1: // handle at circle border
sizeR = newY;
sizeC = newX;
HOperatorSet.DistancePp(new HTuple(sizeR), new HTuple(sizeC),
new HTuple(midR), new HTuple(midC), out distance);
radius = distance[0].D;
determineArcHandles();
break;
case 2: // start handle for arc
dirY = newY - midR;
dirX = newX - midC;
startPhi = Math.Atan2(-dirY, dirX);
if (startPhi < 0)
startPhi = PI + (startPhi + PI);
setStartHandle();
prior = extentPhi;
extentPhi = HMisc.AngleLl(midR, midC, startR, startC, midR, midC, extentR, extentC);
if (extentPhi < 0 && prior > PI * 0.8)
extentPhi = (PI + extentPhi) + PI;
else if (extentPhi > 0 && prior < -PI * 0.7)
extentPhi = -PI - (PI - extentPhi);
break;
case 3: // end handle for arc
dirY = newY - midR;
dirX = newX - midC;
prior = extentPhi;
next = Math.Atan2(-dirY, dirX);
if (next < 0)
next = PI + (next + PI);
if (circDir == "positive" && startPhi >= next)
extentPhi = (next + TwoPI) - startPhi;
else if (circDir == "positive" && next > startPhi)
extentPhi = next - startPhi;
else if (circDir == "negative" && startPhi >= next)
extentPhi = -1.0 * (startPhi - next);
else if (circDir == "negative" && next > startPhi)
extentPhi = -1.0 * (startPhi + TwoPI - next);
valMax = Math.Max(Math.Abs(prior), Math.Abs(extentPhi));
valMin = Math.Min(Math.Abs(prior), Math.Abs(extentPhi));
if ((valMax - valMin) >= PI)
extentPhi = (circDir == "positive") ? -1.0 * valMin : valMin;
setExtentHandle();
break;
}
circDir = (extentPhi < 0) ? "negative" : "positive";
updateArrowHandle();
}
/// <summary>Gets the HALCON region described by the ROI</summary>
public override HRegion getRegion()
{
HRegion region;
contour.Dispose();
contour.GenCircleContourXld(midR, midC, radius, startPhi, (startPhi + extentPhi), circDir, 1.0);
region = new HRegion(contour);
return region;
}
/// <summary>
/// Gets the model information described by the ROI
/// </summary>
public override HTuple getModelData()
{
return new HTuple(new double[] { midR, midC, radius, startPhi, extentPhi });
}
/// <summary>
/// Auxiliary method to determine the positions of the second and
/// third handle.
/// </summary>
private void determineArcHandles()
{
setStartHandle();
setExtentHandle();
}
/// <summary>
/// Auxiliary method to recalculate the start handle for the arc
/// </summary>
private void setStartHandle()
{
startR = midR - radius * Math.Sin(startPhi);
startC = midC + radius * Math.Cos(startPhi);
}
/// <summary>
/// Auxiliary method to recalculate the extent handle for the arc
/// </summary>
private void setExtentHandle()
{
extentR = midR - radius * Math.Sin(startPhi + extentPhi);
extentC = midC + radius * Math.Cos(startPhi + extentPhi);
}
/// <summary>
/// Auxiliary method to display an arrow at the extent arc position
/// </summary>
private void updateArrowHandle()
{
double row1, col1, row2, col2;
double rowP1, colP1, rowP2, colP2;
double length,dr,dc, halfHW, sign, angleRad;
double headLength = 15;
double headWidth = 15;
arrowHandleXLD.Dispose();
arrowHandleXLD.GenEmptyObj();
row2 = extentR;
col2 = extentC;
angleRad = (startPhi + extentPhi) + Math.PI * 0.5;
sign = (circDir == "negative") ? -1.0 : 1.0;
row1 = row2 + sign * Math.Sin(angleRad) * 20;
col1 = col2 - sign * Math.Cos(angleRad) * 20;
length = HMisc.DistancePp(row1, col1, row2, col2);
if (length == 0)
length = -1;
dr = (row2 - row1) / length;
dc = (col2 - col1) / length;
halfHW = headWidth / 2.0;
rowP1 = row1 + (length - headLength) * dr + halfHW * dc;
rowP2 = row1 + (length - headLength) * dr - halfHW * dc;
colP1 = col1 + (length - headLength) * dc - halfHW * dr;
colP2 = col1 + (length - headLength) * dc + halfHW * dr;
if (length == -1)
arrowHandleXLD.GenContourPolygonXld(row1, col1);
else
arrowHandleXLD.GenContourPolygonXld(new HTuple(new double[] { row1, row2, rowP1, row2, rowP2, row2 }),
new HTuple(new double[] { col1, col2, colP1, col2, colP2, col2 }));
}
}//end of class
}//end of namespace

View File

@@ -0,0 +1,816 @@
using System;
using HalconDotNet;
using ViewWindow;
using System.Collections;
namespace ViewWindow.Model
{
public delegate void FuncROIDelegate();
/// <summary>
/// This class creates and manages ROI objects. It responds
/// to mouse device inputs using the methods mouseDownAction and
/// mouseMoveAction. You don't have to know this class in detail when you
/// build your own C# project. But you must consider a few things if
/// you want to use interactive ROIs in your application: There is a
/// quite close connection between the ROIController and the HWndCtrl
/// class, which means that you must 'register' the ROIController
/// with the HWndCtrl, so the HWndCtrl knows it has to forward user input
/// (like mouse events) to the ROIController class.
/// The visualization and manipulation of the ROI objects is done
/// by the ROIController.
/// This class provides special support for the matching
/// applications by calculating a model region from the list of ROIs. For
/// this, ROIs are added and subtracted according to their sign.
/// </summary>
public class ROIController
{
public bool EditModel = true;
/// <summary>
/// Constant for setting the ROI mode: positive ROI sign.
/// </summary>
public const int MODE_ROI_POS = 21;
/// <summary>
/// Constant for setting the ROI mode: negative ROI sign.
/// </summary>
public const int MODE_ROI_NEG = 22;
/// <summary>
/// Constant for setting the ROI mode: no model region is computed as
/// the sum of all ROI objects.
/// </summary>
public const int MODE_ROI_NONE = 23;
/// <summary>Constant describing an update of the model region</summary>
public const int EVENT_UPDATE_ROI = 50;
public const int EVENT_CHANGED_ROI_SIGN = 51;
/// <summary>Constant describing an update of the model region</summary>
public const int EVENT_MOVING_ROI = 52;
public const int EVENT_DELETED_ACTROI = 53;
public const int EVENT_DELETED_ALL_ROIS = 54;
public const int EVENT_ACTIVATED_ROI = 55;
public const int EVENT_CREATED_ROI = 56;
private ROI roiMode;
private int stateROI;
private double currX, currY;
/// <summary>Index of the active ROI object</summary>
public int activeROIidx;
public int deletedIdx;
/// <summary>List containing all created ROI objects so far</summary>
public ArrayList ROIList;
/// <summary>
/// Region obtained by summing up all negative
/// and positive ROI objects from the ROIList
/// </summary>
public HRegion ModelROI;
private string activeCol = "green";
private string activeHdlCol = "red";
private string inactiveCol = "blue";
/// <summary>
/// Reference to the HWndCtrl, the ROI Controller is registered to
/// </summary>
public HWndCtrl viewController;
/// <summary>
/// Delegate that notifies about changes made in the model region
/// </summary>
public IconicDelegate NotifyRCObserver;
/// <summary>Constructor</summary>
protected internal ROIController()
{
stateROI = MODE_ROI_NONE;
ROIList = new ArrayList();
activeROIidx = -1;
ModelROI = new HRegion();
NotifyRCObserver = new IconicDelegate(dummyI);
deletedIdx = -1;
currX = currY = -1;
}
/// <summary>Registers the HWndCtrl to this ROIController instance</summary>
public void setViewController(HWndCtrl view)
{
viewController = view;
}
/// <summary>Gets the ModelROI object</summary>
public HRegion getModelRegion()
{
return ModelROI;
}
/// <summary>Gets the List of ROIs created so far</summary>
public ArrayList getROIList()
{
return ROIList;
}
/// <summary>Get the active ROI</summary>
public ROI getActiveROI()
{
try
{
if (activeROIidx != -1)
return ((ROI)ROIList[activeROIidx]);
return null;
}
catch (Exception)
{
return null;
}
}
public int getActiveROIIdx()
{
return activeROIidx;
}
public void setActiveROIIdx(int active)
{
activeROIidx = active;
}
public int getDelROIIdx()
{
return deletedIdx;
}
/// <summary>
/// To create a new ROI object the application class initializes a
/// 'seed' ROI instance and passes it to the ROIController.
/// The ROIController now responds by manipulating this new ROI
/// instance.
/// </summary>
/// <param name="r">
/// 'Seed' ROI object forwarded by the application forms class.
/// </param>
public void setROIShape(ROI r)
{
roiMode = r;
roiMode.setOperatorFlag(stateROI);
}
/// <summary>
/// Sets the sign of a ROI object to the value 'mode' (MODE_ROI_NONE,
/// MODE_ROI_POS,MODE_ROI_NEG)
/// </summary>
public void setROISign(int mode)
{
stateROI = mode;
if (activeROIidx != -1)
{
((ROI)ROIList[activeROIidx]).setOperatorFlag(stateROI);
viewController.repaint();
NotifyRCObserver(ROIController.EVENT_CHANGED_ROI_SIGN);
}
}
/// <summary>
/// Removes the ROI object that is marked as active.
/// If no ROI object is active, then nothing happens.
/// </summary>
public void removeActive()
{
if (activeROIidx != -1)
{
ROIList.RemoveAt(activeROIidx);
deletedIdx = activeROIidx;
activeROIidx = -1;
viewController.repaint();
NotifyRCObserver(EVENT_DELETED_ACTROI);
}
}
/// <summary>
/// Calculates the ModelROI region for all objects contained
/// in ROIList, by adding and subtracting the positive and
/// negative ROI objects.
/// </summary>
public bool defineModelROI()
{
HRegion tmpAdd, tmpDiff, tmp;
double row, col;
if (stateROI == MODE_ROI_NONE)
return true;
tmpAdd = new HRegion();
tmpDiff = new HRegion();
tmpAdd.GenEmptyRegion();
tmpDiff.GenEmptyRegion();
for (int i=0; i < ROIList.Count; i++)
{
switch (((ROI)ROIList[i]).getOperatorFlag())
{
case ROI.POSITIVE_FLAG:
tmp = ((ROI)ROIList[i]).getRegion();
tmpAdd = tmp.Union2(tmpAdd);
break;
case ROI.NEGATIVE_FLAG:
tmp = ((ROI)ROIList[i]).getRegion();
tmpDiff = tmp.Union2(tmpDiff);
break;
default:
break;
}//end of switch
}//end of for
ModelROI = null;
if (tmpAdd.AreaCenter(out row, out col) > 0)
{
tmp = tmpAdd.Difference(tmpDiff);
if (tmp.AreaCenter(out row, out col) > 0)
ModelROI = tmp;
}
//in case the set of positiv and negative ROIs dissolve
if (ModelROI == null || ROIList.Count == 0)
return false;
return true;
}
/// <summary>
/// Clears all variables managing ROI objects
/// </summary>
public void reset()
{
ROIList.Clear();
activeROIidx = -1;
ModelROI = null;
roiMode = null;
NotifyRCObserver(EVENT_DELETED_ALL_ROIS);
}
/// <summary>
/// Deletes this ROI instance if a 'seed' ROI object has been passed
/// to the ROIController by the application class.
///
/// </summary>
public void resetROI()
{
activeROIidx = -1;
roiMode = null;
}
/// <summary>Defines the colors for the ROI objects</summary>
/// <param name="aColor">Color for the active ROI object</param>
/// <param name="inaColor">Color for the inactive ROI objects</param>
/// <param name="aHdlColor">
/// Color for the active handle of the active ROI object
/// </param>
public void setDrawColor(string aColor,
string aHdlColor,
string inaColor)
{
if (aColor != "")
activeCol = aColor;
if (aHdlColor != "")
activeHdlCol = aHdlColor;
if (inaColor != "")
inactiveCol = inaColor;
}
/// <summary>
/// Paints all objects from the ROIList into the HALCON window
/// </summary>
/// <param name="window">HALCON window</param>
internal void paintData(HalconDotNet.HWindow window)
{
window.SetDraw("margin");
window.SetLineWidth(1);
if (ROIList.Count > 0)
{
window.SetColor(inactiveCol);
window.SetDraw("margin");
for (int i = 0; i < ROIList.Count; i++)
{
window.SetLineStyle(((ROI)ROIList[i]).flagLineStyle);
((ROI)ROIList[i]).draw(window);
}
if (activeROIidx != -1)
{
window.SetColor(activeCol);
window.SetLineStyle(((ROI)ROIList[activeROIidx]).flagLineStyle);
((ROI)ROIList[activeROIidx]).draw(window);
window.SetColor(activeHdlCol);
((ROI)ROIList[activeROIidx]).displayActive(window);
}
}
}
/// <summary>
/// 以指定颜色显示ROI
/// </summary>
/// <param name="window"></param>
internal void paintData(HalconDotNet.HWindow window,string color)
{
window.SetDraw("margin");
window.SetLineWidth(1);
if (ROIList.Count > 0)
{
window.SetColor(color);
window.SetDraw("margin");
for (int i = 0; i < ROIList.Count; i++)
{
window.SetLineStyle(((ROI)ROIList[i]).flagLineStyle);
((ROI)ROIList[i]).draw(window);
}
if (activeROIidx != -1)
{
window.SetColor(color);
window.SetLineStyle(((ROI)ROIList[activeROIidx]).flagLineStyle);
((ROI)ROIList[activeROIidx]).draw(window);
window.SetColor(color);
((ROI)ROIList[activeROIidx]).displayActive(window);
}
}
}
/// <summary>
/// Reaction of ROI objects to the 'mouse button down' event: changing
/// the shape of the ROI and adding it to the ROIList if it is a 'seed'
/// ROI.
/// </summary>
/// <param name="imgX">x coordinate of mouse event</param>
/// <param name="imgY">y coordinate of mouse event</param>
/// <returns></returns>
public int mouseDownAction(double imgX, double imgY)
{
int idxROI= -1;
double max = 10000, dist = 0;
double epsilon = 35.0; //maximal shortest distance to one of
//the handles
if (roiMode != null) //either a new ROI object is created
{
roiMode.createROI(imgX, imgY);
ROIList.Add(roiMode);
roiMode = null;
activeROIidx = ROIList.Count - 1;
viewController.repaint();
NotifyRCObserver(ROIController.EVENT_CREATED_ROI);
}
else if (ROIList.Count > 0) // ... or an existing one is manipulated
{
activeROIidx = -1;
for (int i =0; i < ROIList.Count; i++)
{
dist = ((ROI)ROIList[i]).distToClosestHandle(imgX, imgY);
if ((dist < max) && (dist < epsilon))
{
max = dist;
idxROI = i;
}
}//end of for
if (idxROI >= 0)
{
activeROIidx = idxROI;
NotifyRCObserver(ROIController.EVENT_ACTIVATED_ROI);
}
viewController.repaint();
}
return activeROIidx;
}
/// <summary>
/// Reaction of ROI objects to the 'mouse button move' event: moving
/// the active ROI.
/// </summary>
/// <param name="newX">x coordinate of mouse event</param>
/// <param name="newY">y coordinate of mouse event</param>
public void mouseMoveAction(double newX, double newY)
{
try
{
if(EditModel ==false) return;
if ((newX == currX) && (newY == currY))
return;
((ROI)ROIList[activeROIidx]).moveByHandle(newX, newY);
viewController.repaint();
currX = newX;
currY = newY;
NotifyRCObserver(ROIController.EVENT_MOVING_ROI);
}
catch (Exception)
{
//没有显示roi的时候 移动鼠标会报错
}
}
/***********************************************************/
public void dummyI(int v)
{
}
/*****************************/
/// <summary>
/// 在指定位置显示ROI--Rectangle1
/// </summary>
/// <param name="row1"></param>
/// <param name="col1"></param>
/// <param name="row2"></param>
/// <param name="col2"></param>
/// <param name="rois"></param>
public void displayRect1(string color, double row1, double col1, double row2, double col2)
{
setROIShape(new ROIRectangle1());
if (roiMode != null) //either a new ROI object is created
{
roiMode.createRectangle1(row1, col1, row2, col2);
roiMode.Type = roiMode.GetType().Name;
roiMode.Color = color;
ROIList.Add(roiMode);
roiMode = null;
activeROIidx = ROIList.Count - 1;
viewController.repaint("blue");
NotifyRCObserver(ROIController.EVENT_CREATED_ROI);
}
}
/// <summary>
/// 在指定位置显示ROI--Rectangle2
/// </summary>
/// <param name="row"></param>
/// <param name="col"></param>
/// <param name="phi"></param>
/// <param name="length1"></param>
/// <param name="length2"></param>
/// <param name="rois"></param>
public void displayRect2(string color,double row, double col, double phi, double length1, double length2)
{
setROIShape(new ROIRectangle2());
if (roiMode != null) //either a new ROI object is created
{
roiMode.createRectangle2(row, col, phi, length1, length2);
roiMode.Type = roiMode.GetType().Name;
roiMode.Color = color;
ROIList.Add(roiMode);
roiMode = null;
activeROIidx = ROIList.Count - 1;
viewController.repaint();
NotifyRCObserver(ROIController.EVENT_CREATED_ROI);
}
}
/// <summary>
/// 在指定位置生成ROI--Circle
/// </summary>
/// <param name="row"></param>
/// <param name="col"></param>
/// <param name="radius"></param>
/// <param name="rois"></param>
public void displayCircle(string color, double row, double col, double radius)
{
setROIShape(new ROICircle());
if (roiMode != null) //either a new ROI object is created
{
roiMode.createCircle(row, col, radius);
roiMode.Type = roiMode.GetType().Name;
roiMode.Color = color;
ROIList.Add(roiMode);
roiMode = null;
activeROIidx = ROIList.Count - 1;
viewController.repaint();
NotifyRCObserver(ROIController.EVENT_CREATED_ROI);
}
}
public void displayCircularArc(string color, double row, double col, double radius, double startPhi, double extentPhi)
{
setROIShape(new ROICircle());
if (roiMode != null) //either a new ROI object is created
{
roiMode.createCircularArc(row, col, radius, startPhi, extentPhi, "positive");
roiMode.Type = roiMode.GetType().Name;
roiMode.Color = color;
ROIList.Add(roiMode);
roiMode = null;
activeROIidx = ROIList.Count - 1;
viewController.repaint();
NotifyRCObserver(ROIController.EVENT_CREATED_ROI);
}
}
/// <summary>
/// 在指定位置显示ROI--Line
/// </summary>
/// <param name="beginRow"></param>
/// <param name="beginCol"></param>
/// <param name="endRow"></param>
/// <param name="endCol"></param>
/// <param name="rois"></param>
public void displayLine(string color, double beginRow, double beginCol, double endRow, double endCol)
{
this.setROIShape(new ROILine());
if (roiMode != null) //either a new ROI object is created
{
roiMode.createLine(beginRow, beginCol, endRow, endCol);
roiMode.Type = roiMode.GetType().Name;
roiMode.Color = color;
ROIList.Add(roiMode);
roiMode = null;
activeROIidx = ROIList.Count - 1;
viewController.repaint();
NotifyRCObserver(ROIController.EVENT_CREATED_ROI);
}
}
/// <summary>
/// 在指定位置生成ROI--Rectangle1
/// </summary>
/// <param name="row1"></param>
/// <param name="col1"></param>
/// <param name="row2"></param>
/// <param name="col2"></param>
/// <param name="rois"></param>
public void genRect1(double row1, double col1, double row2, double col2, ref System.Collections.Generic.List<ROI> rois)
{
setROIShape(new ROIRectangle1());
if (rois == null)
{
rois = new System.Collections.Generic.List<ROI>();
}
if (roiMode != null) //either a new ROI object is created
{
roiMode.createRectangle1(row1, col1, row2, col2);
roiMode.Type = roiMode.GetType().Name;
rois.Add(roiMode);
ROIList.Add(roiMode);
roiMode = null;
activeROIidx = ROIList.Count - 1;
viewController.repaint();
NotifyRCObserver(ROIController.EVENT_CREATED_ROI);
}
}
/// <summary>
/// 在指定位置生成ROI--Rectangle2
/// </summary>
/// <param name="row"></param>
/// <param name="col"></param>
/// <param name="phi"></param>
/// <param name="length1"></param>
/// <param name="length2"></param>
/// <param name="rois"></param>
public void genRect2(double row, double col, double phi, double length1, double length2, ref System.Collections.Generic.List<ROI> rois)
{
setROIShape(new ROIRectangle2());
if (rois == null)
{
rois = new System.Collections.Generic.List<ROI>();
}
if (roiMode != null) //either a new ROI object is created
{
roiMode.createRectangle2(row, col, phi, length1, length2);
roiMode.Type = roiMode.GetType().Name;
rois.Add(roiMode);
ROIList.Add(roiMode);
roiMode = null;
activeROIidx = ROIList.Count - 1;
viewController.repaint();
NotifyRCObserver(ROIController.EVENT_CREATED_ROI);
}
}
/// <summary>
/// 在指定位置生成ROI--Circle
/// </summary>
/// <param name="row"></param>
/// <param name="col"></param>
/// <param name="radius"></param>
/// <param name="rois"></param>
public void genCircle(double row, double col, double radius, ref System.Collections.Generic.List<ROI> rois)
{
setROIShape(new ROICircle());
if (rois == null)
{
rois = new System.Collections.Generic.List<ROI>();
}
if (roiMode != null) //either a new ROI object is created
{
roiMode.createCircle(row, col, radius);
roiMode.Type = roiMode.GetType().Name;
rois.Add(roiMode);
ROIList.Add(roiMode);
roiMode = null;
activeROIidx = ROIList.Count - 1;
viewController.repaint();
NotifyRCObserver(ROIController.EVENT_CREATED_ROI);
}
}
public void genCircularArc(double row, double col, double radius, double startPhi, double extentPhi, string direct, ref System.Collections.Generic.List<ROI> rois)
{
setROIShape(new ROICircularArc());
if (rois == null)
{
rois = new System.Collections.Generic.List<ROI>();
}
if (roiMode != null) //either a new ROI object is created
{
roiMode.createCircularArc(row, col, radius, startPhi, extentPhi, direct);
roiMode.Type = roiMode.GetType().Name;
rois.Add(roiMode);
ROIList.Add(roiMode);
roiMode = null;
activeROIidx = ROIList.Count - 1;
viewController.repaint();
NotifyRCObserver(ROIController.EVENT_CREATED_ROI);
}
}
/// <summary>
/// 在指定位置生成ROI--Line
/// </summary>
/// <param name="beginRow"></param>
/// <param name="beginCol"></param>
/// <param name="endRow"></param>
/// <param name="endCol"></param>
/// <param name="rois"></param>
protected internal void genLine(double beginRow, double beginCol, double endRow, double endCol, ref System.Collections.Generic.List<ROI> rois)
{
this.setROIShape(new ROILine());
if (rois == null)
{
rois = new System.Collections.Generic.List<ROI>();
}
if (roiMode != null) //either a new ROI object is created
{
roiMode.createLine(beginRow, beginCol, endRow, endCol);
roiMode.Type = roiMode.GetType().Name;
rois.Add(roiMode);
ROIList.Add(roiMode);
roiMode = null;
activeROIidx = ROIList.Count - 1;
viewController.repaint();
NotifyRCObserver(ROIController.EVENT_CREATED_ROI);
}
}
/// <summary>
/// 获取当前选中ROI的信息
/// </summary>
/// <returns></returns>
protected internal System.Collections.Generic.List<double> smallestActiveROI(out string name, out int index)
{
name = "";
int activeROIIdx = this.getActiveROIIdx();
index = activeROIIdx;
if (activeROIIdx > -1)
{
ROI region = this.getActiveROI();
Type type = region.GetType();
name = type.Name;
HTuple smallest = region.getModelData();
System.Collections.Generic.List<double> resual = new System.Collections.Generic.List<double>();
for (int i = 0; i < smallest.Length; i++)
{
resual.Add(smallest[i].D);
}
return resual;
}
else
{
return null;
}
}
protected internal ROI smallestActiveROI(out System.Collections.Generic.List<double> data, out int index)
{
try
{
int activeROIIdx = this.getActiveROIIdx();
index = activeROIIdx;
data = new System.Collections.Generic.List<double>();
if (activeROIIdx > -1)
{
ROI region = this.getActiveROI();
Type type = region.GetType();
HTuple smallest = region.getModelData();
for (int i = 0; i < smallest.Length; i++)
{
data.Add(smallest[i].D);
}
return region;
}
else
{
return null;
}
}
catch (Exception)
{
data = null;
index = 0;
return null;
}
}
/// <summary>
/// 删除当前选中ROI
/// </summary>
/// <param name="roi"></param>
protected internal void removeActiveROI(ref System.Collections.Generic.List<ROI> roi)
{
int activeROIIdx = this.getActiveROIIdx();
if (activeROIIdx > -1)
{
this.removeActive();
roi.RemoveAt(activeROIIdx);
}
}
/// <summary>
/// 选中激活ROI
/// </summary>
/// <param name="index"></param>
protected internal void selectROI(int index)
{
this.activeROIidx = index;
this.NotifyRCObserver(ROIController.EVENT_ACTIVATED_ROI);
this.viewController.repaint();
}
/// <summary>
/// 复位窗口显示
/// </summary>
protected internal void resetWindowImage()
{
//this.viewController.resetWindow();
this.viewController.repaint();
}
protected internal void zoomWindowImage()
{
this.viewController.setViewState(HWndCtrl.MODE_VIEW_ZOOM);
}
protected internal void moveWindowImage()
{
this.viewController.setViewState(HWndCtrl.MODE_VIEW_MOVE);
}
protected internal void noneWindowImage()
{
this.viewController.setViewState(HWndCtrl.MODE_VIEW_NONE);
}
}//end of class
}//end of namespace

View File

@@ -0,0 +1,249 @@
using System;
using HalconDotNet;
using System.Xml.Serialization;
namespace ViewWindow.Model
{
/// <summary>
/// This class demonstrates one of the possible implementations for a
/// linear ROI. ROILine inherits from the base class ROI and
/// implements (besides other auxiliary methods) all virtual methods
/// defined in ROI.cs.
/// </summary>
[Serializable]
public class ROILine : ROI
{
[XmlElement(ElementName = "RowBegin")]
public double RowBegin
{
get { return this.row1; }
set { this.row1 = value; }
}
[XmlElement(ElementName = "ColumnBegin")]
public double ColumnBegin
{
get { return this.col1; }
set { this.col1 = value; }
}
[XmlElement(ElementName = "RowEnd")]
public double RowEnd
{
get { return this.row2; }
set { this.row2 = value; }
}
[XmlElement(ElementName = "ColumnEnd")]
public double ColumnEnd
{
get { return this.col2; }
set { this.col2 = value; }
}
private double row1, col1; // first end point of line
private double row2, col2; // second end point of line
private double midR, midC; // midPoint of line
private HObject arrowHandleXLD;
public ROILine()
{
NumHandles = 3; // two end points of line
activeHandleIdx = 2;
arrowHandleXLD = new HXLDCont();
arrowHandleXLD.GenEmptyObj();
}
public ROILine(double beginRow, double beginCol, double endRow, double endCol)
{
createLine(beginRow, beginCol, endRow, endCol);
}
public override void createLine(double beginRow, double beginCol, double endRow, double endCol)
{
base.createLine(beginRow, beginCol, endRow, endCol);
row1 = beginRow;
col1 = beginCol;
row2 = endRow;
col2 = endCol;
midR = (row1 + row2) / 2.0;
midC = (col1 + col2) / 2.0;
updateArrowHandle();
}
/// <summary>Creates a new ROI instance at the mouse position.</summary>
public override void createROI(double midX, double midY)
{
midR = midY;
midC = midX;
row1 = midR;
col1 = midC - 50;
row2 = midR;
col2 = midC + 50;
updateArrowHandle();
}
/// <summary>Paints the ROI into the supplied window.</summary>
public override void draw(HalconDotNet.HWindow window)
{
window.DispLine(row1, col1, row2, col2);
window.DispRectangle2(row1, col1, 0, 8, 8);
window.DispObj(arrowHandleXLD); //window.DispRectangle2( row2, col2, 0, 25, 25);
window.DispRectangle2(midR, midC, 0, 8, 8);
}
/// <summary>
/// Returns the distance of the ROI handle being
/// closest to the image point(x,y).
/// </summary>
public override double distToClosestHandle(double x, double y)
{
double max = 10000;
double [] val = new double[NumHandles];
val[0] = HMisc.DistancePp(y, x, row1, col1); // upper left
val[1] = HMisc.DistancePp(y, x, row2, col2); // upper right
val[2] = HMisc.DistancePp(y, x, midR, midC); // midpoint
for (int i=0; i < NumHandles; i++)
{
if (val[i] < max)
{
max = val[i];
activeHandleIdx = i;
}
}// end of for
return val[activeHandleIdx];
}
/// <summary>
/// Paints the active handle of the ROI object into the supplied window.
/// </summary>
public override void displayActive(HalconDotNet.HWindow window)
{
switch (activeHandleIdx)
{
case 0:
window.DispRectangle2(row1, col1, 0, 8, 8);
break;
case 1:
window.DispObj(arrowHandleXLD); //window.DispRectangle2(row2, col2, 0, 25, 25);
break;
case 2:
window.DispRectangle2(midR, midC, 0, 8, 8);
break;
}
}
/// <summary>Gets the HALCON region described by the ROI.</summary>
public override HRegion getRegion()
{
HRegion region = new HRegion();
region.GenRegionLine(row1, col1, row2, col2);
return region;
}
public override double getDistanceFromStartPoint(double row, double col)
{
double distance = HMisc.DistancePp(row, col, row1, col1);
return distance;
}
/// <summary>
/// Gets the model information described by
/// the ROI.
/// </summary>
public override HTuple getModelData()
{
return new HTuple(new double[] { row1, col1, row2, col2 });
}
/// <summary>
/// Recalculates the shape of the ROI. Translation is
/// performed at the active handle of the ROI object
/// for the image coordinate (x,y).
/// </summary>
public override void moveByHandle(double newX, double newY)
{
double lenR, lenC;
switch (activeHandleIdx)
{
case 0: // first end point
row1 = newY;
col1 = newX;
midR = (row1 + row2) / 2;
midC = (col1 + col2) / 2;
break;
case 1: // last end point
row2 = newY;
col2 = newX;
midR = (row1 + row2) / 2;
midC = (col1 + col2) / 2;
break;
case 2: // midpoint
lenR = row1 - midR;
lenC = col1 - midC;
midR = newY;
midC = newX;
row1 = midR + lenR;
col1 = midC + lenC;
row2 = midR - lenR;
col2 = midC - lenC;
break;
}
updateArrowHandle();
}
/// <summary> Auxiliary method </summary>
private void updateArrowHandle()
{
double length,dr,dc, halfHW;
double rrow1, ccol1,rowP1, colP1, rowP2, colP2;
double headLength = 16;
double headWidth = 16;
arrowHandleXLD.Dispose();
arrowHandleXLD.GenEmptyObj();
rrow1 = row1 + (row2 - row1) * 0.9;
ccol1 = col1 + (col2 - col1) * 0.9;
length = HMisc.DistancePp(rrow1, ccol1, row2, col2);
if (length == 0)
length = -1;
dr = (row2 - rrow1) / length;
dc = (col2 - ccol1) / length;
halfHW = headWidth / 2.0;
rowP1 = rrow1 + (length - headLength) * dr + halfHW * dc;
rowP2 = rrow1 + (length - headLength) * dr - halfHW * dc;
colP1 = ccol1 + (length - headLength) * dc - halfHW * dr;
colP2 = ccol1 + (length - headLength) * dc + halfHW * dr;
if (length == -1)
HOperatorSet.GenContourPolygonXld(out arrowHandleXLD,rrow1, ccol1);
else
HOperatorSet.GenContourPolygonXld(out arrowHandleXLD, new HTuple(new double[] { rrow1, row2, rowP1, row2, rowP2, row2 }),
new HTuple(new double[] { ccol1, col2, colP1, col2, colP2, col2 }));
}
}//end of class
}//end of namespace

View File

@@ -0,0 +1,255 @@
using System;
using HalconDotNet;
using System.Xml.Serialization;
namespace ViewWindow.Model
{
/// <summary>
/// This class demonstrates one of the possible implementations for a
/// (simple) rectangularly shaped ROI. ROIRectangle1 inherits
/// from the base class ROI and implements (besides other auxiliary
/// methods) all virtual methods defined in ROI.cs.
/// Since a simple rectangle is defined by two data points, by the upper
/// left corner and the lower right corner, we use four values (row1/col1)
/// and (row2/col2) as class members to hold these positions at
/// any time of the program. The four corners of the rectangle can be taken
/// as handles, which the user can use to manipulate the size of the ROI.
/// Furthermore, we define a midpoint as an additional handle, with which
/// the user can grab and drag the ROI. Therefore, we declare NumHandles
/// to be 5 and set the activeHandle to be 0, which will be the upper left
/// corner of our ROI.
/// </summary>
[Serializable]
public class ROIRectangle1 : ROI
{
[XmlElement(ElementName = "Row1")]
public double Row1
{
get { return this.row1; }
set { this.row1 = value; }
}
[XmlElement(ElementName = "Column1")]
public double Column1
{
get { return this.col1; }
set { this.col1 = value; }
}
[XmlElement(ElementName = "Row2")]
public double Row2
{
get { return this.row2; }
set { this.row2 = value; }
}
[XmlElement(ElementName = "Column2")]
public double Column2
{
get { return this.col2; }
set { this.col2 = value; }
}
private string color = "yellow";
private double row1, col1; // upper left
private double row2, col2; // lower right
private double midR, midC; // midpoint
/// <summary>Constructor</summary>
public ROIRectangle1()
{
NumHandles = 5; // 4 corner points + midpoint
activeHandleIdx = 4;
}
public ROIRectangle1(double row1, double col1, double row2, double col2)
{
createRectangle1(row1, col1, row2, col2);
}
public override void createRectangle1(double row1, double col1, double row2, double col2)
{
base.createRectangle1(row1, col1, row2, col2);
this.row1 = row1;
this.col1 = col1;
this.row2 = row2;
this.col2 = col2;
midR = (this.row1 + this.row2) / 2.0;
midC = (this.col1 + this.col2) / 2.0;
}
/// <summary>Creates a new ROI instance at the mouse position</summary>
/// <param name="midX">
/// x (=column) coordinate for interactive ROI
/// </param>
/// <param name="midY">
/// y (=row) coordinate for interactive ROI
/// </param>
public override void createROI(double midX, double midY)
{
midR = midY;
midC = midX;
row1 = midR - 25;
col1 = midC - 25;
row2 = midR + 25;
col2 = midC + 25;
}
/// <summary>Paints the ROI into the supplied window</summary>
/// <param name="window">HALCON window</param>
public override void draw(HalconDotNet.HWindow window)
{
window.DispRectangle1(row1, col1, row2, col2);
window.DispRectangle2(row1, col1, 0, 8,8);
window.DispRectangle2(row1, col2, 0, 8,8);
window.DispRectangle2(row2, col2, 0, 8,8);
window.DispRectangle2(row2, col1, 0, 8,8);
window.DispRectangle2(midR, midC, 0, 8,8);
}
/// <summary>
/// Returns the distance of the ROI handle being
/// closest to the image point(x,y)
/// </summary>
/// <param name="x">x (=column) coordinate</param>
/// <param name="y">y (=row) coordinate</param>
/// <returns>
/// Distance of the closest ROI handle.
/// </returns>
public override double distToClosestHandle(double x, double y)
{
double max = 10000;
double [] val = new double[NumHandles];
midR = ((row2 - row1) / 2) + row1;
midC = ((col2 - col1) / 2) + col1;
val[0] = HMisc.DistancePp(y, x, row1, col1); // upper left
val[1] = HMisc.DistancePp(y, x, row1, col2); // upper right
val[2] = HMisc.DistancePp(y, x, row2, col2); // lower right
val[3] = HMisc.DistancePp(y, x, row2, col1); // lower left
val[4] = HMisc.DistancePp(y, x, midR, midC); // midpoint
for (int i=0; i < NumHandles; i++)
{
if (val[i] < max)
{
max = val[i];
activeHandleIdx = i;
}
}// end of for
return val[activeHandleIdx];
}
/// <summary>
/// Paints the active handle of the ROI object into the supplied window
/// </summary>
/// <param name="window">HALCON window</param>
public override void displayActive(HalconDotNet.HWindow window)
{
switch (activeHandleIdx)
{
case 0:
window.DispRectangle2(row1, col1, 0, 8,8);
break;
case 1:
window.DispRectangle2(row1, col2, 0, 8,8);
break;
case 2:
window.DispRectangle2(row2, col2, 0, 8,8);
break;
case 3:
window.DispRectangle2(row2, col1, 0, 8,8);
break;
case 4:
window.DispRectangle2(midR, midC, 0, 8,8);
break;
}
}
/// <summary>Gets the HALCON region described by the ROI</summary>
public override HRegion getRegion()
{
HRegion region = new HRegion();
region.GenRectangle1(row1, col1, row2, col2);
return region;
}
/// <summary>
/// Gets the model information described by
/// the interactive ROI
/// </summary>
public override HTuple getModelData()
{
return new HTuple(new double[] { row1, col1, row2, col2 });
}
/// <summary>
/// Recalculates the shape of the ROI instance. Translation is
/// performed at the active handle of the ROI object
/// for the image coordinate (x,y)
/// </summary>
/// <param name="newX">x mouse coordinate</param>
/// <param name="newY">y mouse coordinate</param>
public override void moveByHandle(double newX, double newY)
{
double len1, len2;
double tmp;
switch (activeHandleIdx)
{
case 0: // upper left
row1 = newY;
col1 = newX;
break;
case 1: // upper right
row1 = newY;
col2 = newX;
break;
case 2: // lower right
row2 = newY;
col2 = newX;
break;
case 3: // lower left
row2 = newY;
col1 = newX;
break;
case 4: // midpoint
len1 = ((row2 - row1) / 2);
len2 = ((col2 - col1) / 2);
row1 = newY - len1;
row2 = newY + len1;
col1 = newX - len2;
col2 = newX + len2;
break;
}
if (row2 <= row1)
{
tmp = row1;
row1 = row2;
row2 = tmp;
}
if (col2 <= col1)
{
tmp = col1;
col1 = col2;
col2 = tmp;
}
midR = ((row2 - row1) / 2) + row1;
midC = ((col2 - col1) / 2) + col1;
}//end of method
}//end of class
}//end of namespace

View File

@@ -0,0 +1,310 @@
using System;
using HalconDotNet;
using System.Xml.Serialization;
namespace ViewWindow.Model
{
/// <summary>
/// This class demonstrates one of the possible implementations for a
/// (simple) rectangularly shaped ROI. To create this rectangle we use
/// a center point (midR, midC), an orientation 'phi' and the half
/// edge lengths 'length1' and 'length2', similar to the HALCON
/// operator gen_rectangle2().
/// The class ROIRectangle2 inherits from the base class ROI and
/// implements (besides other auxiliary methods) all virtual methods
/// defined in ROI.cs.
/// </summary>
[Serializable]
public class ROIRectangle2 : ROI
{
[XmlElement(ElementName = "Row")]
public double Row
{
get { return this.midR; }
set { this.midR = value; }
}
[XmlElement(ElementName = "Column")]
public double Column
{
get { return this.midC; }
set { this.midC = value; }
}
[XmlElement(ElementName = "Phi")]
public double Phi
{
get { return this.phi; }
set { this.phi = value; }
}
[XmlElement(ElementName = "Length1")]
public double Lenth1
{
get { return this.length1; }
set { this.length1 = value; }
}
[XmlElement(ElementName = "Length2")]
public double Lenth2
{
get { return this.length2; }
set { this.length2 = value; }
}
/// <summary>Half length of the rectangle side, perpendicular to phi</summary>
private double length1;
/// <summary>Half length of the rectangle side, in direction of phi</summary>
private double length2;
/// <summary>Row coordinate of midpoint of the rectangle</summary>
private double midR;
/// <summary>Column coordinate of midpoint of the rectangle</summary>
private double midC;
/// <summary>Orientation of rectangle defined in radians.</summary>
private double phi;
//auxiliary variables
HTuple rowsInit;
HTuple colsInit;
HTuple rows;
HTuple cols;
HHomMat2D hom2D, tmp;
/// <summary>Constructor</summary>
public ROIRectangle2()
{
NumHandles = 6; // 4 corners + 1 midpoint + 1 rotationpoint
activeHandleIdx = 4;
}
public ROIRectangle2(double row, double col, double phi, double length1, double length2)
{
createRectangle2(row, col, phi, length1, length2);
}
public override void createRectangle2(double row, double col, double phi, double length1, double length2)
{
base.createRectangle2(row, col, phi, length1, length2);
this.midR = row;
this.midC = col;
this.length1 = length1;
this.length2 = length2;
this.phi = phi;
rowsInit = new HTuple(new double[] {-1.0, -1.0, 1.0,
1.0, 0.0, 0.0 });
colsInit = new HTuple(new double[] {-1.0, 1.0, 1.0,
-1.0, 0.0, 0.6 });
//order ul , ur, lr, ll, mp, arrowMidpoint
hom2D = new HHomMat2D();
tmp = new HHomMat2D();
updateHandlePos();
}
/// <summary>Creates a new ROI instance at the mouse position</summary>
/// <param name="midX">
/// x (=column) coordinate for interactive ROI
/// </param>
/// <param name="midY">
/// y (=row) coordinate for interactive ROI
/// </param>
public override void createROI(double midX, double midY)
{
midR = midY;
midC = midX;
length1 = 100;
length2 = 50;
phi = 0.0;
rowsInit = new HTuple(new double[] {-1.0, -1.0, 1.0,
1.0, 0.0, 0.0 });
colsInit = new HTuple(new double[] {-1.0, 1.0, 1.0,
-1.0, 0.0, 0.6 });
//order ul , ur, lr, ll, mp, arrowMidpoint
hom2D = new HHomMat2D();
tmp = new HHomMat2D();
updateHandlePos();
}
/// <summary>Paints the ROI into the supplied window</summary>
/// <param name="window">HALCON window</param>
public override void draw(HalconDotNet.HWindow window)
{
window.DispRectangle2(midR, midC, -phi, length1, length2);
for (int i =0; i < NumHandles; i++)
window.DispRectangle2(rows[i].D, cols[i].D, -phi, 8,8);
window.DispArrow(midR, midC, midR + (Math.Sin(phi) * length1 * 1.2),
midC + (Math.Cos(phi) * length1 * 1.2), 5.0);
}
/// <summary>
/// Returns the distance of the ROI handle being
/// closest to the image point(x,y)
/// </summary>
/// <param name="x">x (=column) coordinate</param>
/// <param name="y">y (=row) coordinate</param>
/// <returns>
/// Distance of the closest ROI handle.
/// </returns>
public override double distToClosestHandle(double x, double y)
{
double max = 10000;
double [] val = new double[NumHandles];
for (int i=0; i < NumHandles; i++)
val[i] = HMisc.DistancePp(y, x, rows[i].D, cols[i].D);
for (int i=0; i < NumHandles; i++)
{
if (val[i] < max)
{
max = val[i];
activeHandleIdx = i;
}
}
return val[activeHandleIdx];
}
/// <summary>
/// Paints the active handle of the ROI object into the supplied window
/// </summary>
/// <param name="window">HALCON window</param>
public override void displayActive(HalconDotNet.HWindow window)
{
window.DispRectangle2(rows[activeHandleIdx].D,
cols[activeHandleIdx].D,
-phi, 8,8);
if (activeHandleIdx == 5)
window.DispArrow(midR, midC,
midR + (Math.Sin(phi) * length1 * 1.2),
midC + (Math.Cos(phi) * length1 * 1.2),
5.0);
}
/// <summary>Gets the HALCON region described by the ROI</summary>
public override HRegion getRegion()
{
HRegion region = new HRegion();
region.GenRectangle2(midR, midC, -phi, length1, length2);
return region;
}
/// <summary>
/// Gets the model information described by
/// the interactive ROI
/// </summary>
public override HTuple getModelData()
{
return new HTuple(new double[] { midR, midC, phi, length1, length2 });
}
/// <summary>
/// Recalculates the shape of the ROI instance. Translation is
/// performed at the active handle of the ROI object
/// for the image coordinate (x,y)
/// </summary>
/// <param name="newX">x mouse coordinate</param>
/// <param name="newY">y mouse coordinate</param>
public override void moveByHandle(double newX, double newY)
{
double vX, vY, x=0, y=0;
switch (activeHandleIdx)
{
case 0:
case 1:
case 2:
case 3:
tmp = hom2D.HomMat2dInvert();
x = tmp.AffineTransPoint2d(newX, newY, out y);
length2 = Math.Abs(y);
length1 = Math.Abs(x);
checkForRange(x, y);
break;
case 4:
midC = newX;
midR = newY;
break;
case 5:
vY = newY - rows[4].D;
vX = newX - cols[4].D;
phi = Math.Atan2(vY, vX);
break;
}
updateHandlePos();
}//end of method
/// <summary>
/// Auxiliary method to recalculate the contour points of
/// the rectangle by transforming the initial row and
/// column coordinates (rowsInit, colsInit) by the updated
/// homography hom2D
/// </summary>
private void updateHandlePos()
{
hom2D.HomMat2dIdentity();
hom2D = hom2D.HomMat2dTranslate(midC, midR);
hom2D = hom2D.HomMat2dRotateLocal(phi);
tmp = hom2D.HomMat2dScaleLocal(length1, length2);
cols = tmp.AffineTransPoint2d(colsInit, rowsInit, out rows);
}
/* This auxiliary method checks the half lengths
* (length1, length2) using the coordinates (x,y) of the four
* rectangle corners (handles 0 to 3) to avoid 'bending' of
* the rectangular ROI at its midpoint, when it comes to a
* 'collapse' of the rectangle for length1=length2=0.
* */
private void checkForRange(double x, double y)
{
switch (activeHandleIdx)
{
case 0:
if ((x < 0) && (y < 0))
return;
if (x >= 0) length1 = 0.01;
if (y >= 0) length2 = 0.01;
break;
case 1:
if ((x > 0) && (y < 0))
return;
if (x <= 0) length1 = 0.01;
if (y >= 0) length2 = 0.01;
break;
case 2:
if ((x > 0) && (y > 0))
return;
if (x <= 0) length1 = 0.01;
if (y <= 0) length2 = 0.01;
break;
case 3:
if ((x < 0) && (y > 0))
return;
if (x >= 0) length1 = 0.01;
if (y <= 0) length2 = 0.01;
break;
default:
break;
}
}
}//end of class
}//end of namespace

View File

@@ -0,0 +1,146 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using HalconDotNet;
namespace ViewWindow.Model
{
public class RoiData
{
private int _id;
private string _name;
private Config.Rectangle1 _rectangle1;
private Config.Rectangle2 _rectangle2;
private Config.Circle _circle;
private Config.Line _line;
[XmlElement(ElementName = "ID")]
public int ID
{
get { return this._id; }
set { this._id = value; }
}
[XmlElement(ElementName = "Name")]
public string Name
{
get { return this._name; }
set { this._name = value; }
}
[XmlElement(ElementName = "Rectangle1")]
public Config.Rectangle1 Rectangle1
{
get { return this._rectangle1; }
set { this._rectangle1 = value; }
}
[XmlElement(ElementName = "Rectangle2")]
public Config.Rectangle2 Rectangle2
{
get { return this._rectangle2; }
set { this._rectangle2 = value; }
}
[XmlElement(ElementName = "Circle")]
public Config.Circle Circle
{
get { return this._circle; }
set { this._circle = value; }
}
[XmlElement(ElementName = "Line")]
public Config.Line Line
{
get { return this._line; }
set { this._line = value; }
}
protected internal RoiData()
{
}
protected internal RoiData(int id, ROI roi)
{
this._id = id;
HTuple m_roiData = null;
m_roiData = roi.getModelData();
switch (roi.Type)
{
case "ROIRectangle1":
this._name = "Rectangle1";
if (m_roiData != null)
{
this._rectangle1 = new Config.Rectangle1(m_roiData[0].D, m_roiData[1].D, m_roiData[2].D, m_roiData[3].D);
this._rectangle1.Color = roi.Color;
}
break;
case "ROIRectangle2":
this._name = "Rectangle2";
if (m_roiData != null)
{
this._rectangle2 = new Config.Rectangle2(m_roiData[0].D, m_roiData[1].D, m_roiData[2].D, m_roiData[3].D, m_roiData[4].D);
this._rectangle2.Color = roi.Color;
}
break;
case "ROICircle":
this._name = "Circle";
if (m_roiData != null)
{
this._circle = new Config.Circle(m_roiData[0].D, m_roiData[1].D, m_roiData[2].D);
this._circle.Color = roi.Color;
}
break;
case "ROILine":
this._name = "Line";
if (m_roiData != null)
{
this._line = new Config.Line(m_roiData[0].D, m_roiData[1].D, m_roiData[2].D, m_roiData[3].D);
this._line.Color = roi.Color;
}
break;
default:
break;
}
}
protected internal RoiData(int id, Config.Rectangle1 rectangle1)
{
this._id = id;
this._name = "Rectangle1";
this._rectangle1 = rectangle1;
}
protected internal RoiData(int id, Config.Rectangle2 rectangle2)
{
this._id = id;
this._name = "Rectangle2";
this._rectangle2 = rectangle2;
}
protected internal RoiData(int id, Config.Circle circle)
{
this._id = id;
this._name = "Circle";
this._circle = circle;
}
protected internal RoiData(int id, Config.Line line)
{
this._id = id;
this._name = "Line";
this._line = line;
}
}
}

21
ImageWindow/Program.cs Normal file
View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace ViewROI
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
// Application.Run(new Form1());
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("测试ViewROI")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("测试ViewROI")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("e482f96b-e72f-4825-9015-87073b0142b2")]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 内部版本号
// 修订号
//
// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace ViewROI.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ViewROI.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 使用此强类型资源类,为所有资源查找
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@@ -0,0 +1,117 @@
<?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.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:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace ViewROI.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

BIN
ImageWindow/UpgradeLog.htm Normal file

Binary file not shown.

310
ImageWindow/ViewWindow.cs Normal file
View File

@@ -0,0 +1,310 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HalconDotNet;
namespace ViewWindow
{
public class ViewWindow : Model.IViewWindow
{
public Model.HWndCtrl _hWndControl;
private Model.ROIController _roiController;
public ViewWindow(HWindowControl window)
{
this._hWndControl = new Model.HWndCtrl(window);
this._roiController = new Model.ROIController();
this._hWndControl.setROIController(this._roiController);
this._hWndControl.setViewState(Model.HWndCtrl.MODE_VIEW_NONE);
}
//清空所有显示内容
public void ClearWindow()
{
//清空显示image
_hWndControl.clearList();
//清空hobjectList
_hWndControl.clearHObjectList();
}
public void displayImage(HObject img)
{
//添加背景图片
this._hWndControl.addImageShow(img);
//清空roi容器,不让roi显示
this._roiController.reset();
//显示图片
this._roiController.resetWindowImage();
//this._hWndControl.resetWindow();
// this._hWndControl.resetAll();
//this._hWndControl.repaint();
}
public void notDisplayRoi()
{
this._roiController.reset();
//显示图片
this._roiController.resetWindowImage();
}
//获取当前窗口显示的roi数量
public int getRoiCount()
{
return _roiController.ROIList.Count;
}
//是否开启缩放事件
public void setDrawModel(bool flag)
{
_hWndControl.drawModel = flag;
}
//是否开启编辑事件
public void setEditModel(bool flag)
{
_roiController.EditModel = flag;
// _hWndControl.drawModel = flag;
}
public void resetWindowImage()
{
this._hWndControl.resetWindow();
this._roiController.resetWindowImage();
}
public void mouseleave()
{
_hWndControl.raiseMouseup();
}
public void zoomWindowImage()
{
this._roiController.zoomWindowImage();
}
public void moveWindowImage()
{
this._roiController.moveWindowImage();
}
public void noneWindowImage()
{
this._roiController.noneWindowImage();
}
public void genRect1(double row1, double col1, double row2, double col2, ref List<Model.ROI> rois)
{
this._roiController.genRect1(row1, col1, row2, col2, ref rois);
}
public void genRect2(double row, double col, double phi, double length1, double length2, ref List<Model.ROI> rois)
{
this._roiController.genRect2(row, col, phi, length1, length2, ref rois);
}
public void genCircle(double row, double col, double radius, ref List<Model.ROI> rois)
{
this._roiController.genCircle(row, col, radius, ref rois);
}
public void genCircularArc(double row, double col, double radius, double startPhi, double extentPhi, string direct,ref List<Model.ROI> rois)
{
this._roiController.genCircularArc(row, col, radius, startPhi, extentPhi,direct,ref rois);
}
public void genLine(double beginRow, double beginCol, double endRow, double endCol, ref List<Model.ROI> rois)
{
this._roiController.genLine(beginRow, beginCol, endRow, endCol, ref rois);
}
public List<double> smallestActiveROI(out string name, out int index)
{
List<double> resual = this._roiController.smallestActiveROI(out name,out index);
return resual;
}
public Model.ROI smallestActiveROI(out List<double> data, out int index)
{
Model.ROI roi = this._roiController.smallestActiveROI(out data, out index);
return roi;
}
public void selectROI(int index)
{
this._roiController.selectROI(index);
}
public void selectROI( List<Model.ROI> rois, int index)
{
//this._roiController.selectROI(index);
if ((rois.Count > index)&&(index>=0))
{
this._hWndControl.resetAll();
this._hWndControl.repaint();
HTuple m_roiData = null;
m_roiData = rois[index].getModelData();
switch (rois[index].Type)
{
case "ROIRectangle1":
if (m_roiData != null)
{
this._roiController.displayRect1(rois[index].Color, m_roiData[0].D, m_roiData[1].D, m_roiData[2].D, m_roiData[3].D);
}
break;
case "ROIRectangle2":
if (m_roiData != null)
{
this._roiController.displayRect2(rois[index].Color, m_roiData[0].D, m_roiData[1].D, m_roiData[2].D, m_roiData[3].D, m_roiData[4].D);
}
break;
case "ROICircle":
if (m_roiData != null)
{
this._roiController.displayCircle(rois[index].Color, m_roiData[0].D, m_roiData[1].D, m_roiData[2].D);
}
break;
case "ROICircularArc":
if (m_roiData != null)
{
this._roiController.displayCircularArc(rois[index].Color, m_roiData[0].D, m_roiData[1].D, m_roiData[2].D, m_roiData[3].D, m_roiData[4].D);
}
break;
case "ROILine":
if (m_roiData != null)
{
this._roiController.displayLine(rois[index].Color, m_roiData[0].D, m_roiData[1].D, m_roiData[2].D, m_roiData[3].D);
}
break;
default:
break;
}
}
}
public void displayROI(List<Model.ROI> rois)
{
if (rois == null)
{
return;
}
//this._hWndControl.resetAll();
//this._hWndControl.repaint();
foreach (var roi in rois)
{
HTuple m_roiData = null;
m_roiData = roi.getModelData();
switch (roi.Type)
{
case "ROIRectangle1":
if (m_roiData != null)
{
this._roiController.displayRect1(roi.Color, m_roiData[0].D, m_roiData[1].D, m_roiData[2].D, m_roiData[3].D);
}
break;
case "ROIRectangle2":
if (m_roiData != null)
{
this._roiController.displayRect2(roi.Color, m_roiData[0].D, m_roiData[1].D, m_roiData[2].D, m_roiData[3].D, m_roiData[4].D);
}
break;
case "ROICircle":
if (m_roiData != null)
{
this._roiController.displayCircle(roi.Color, m_roiData[0].D, m_roiData[1].D, m_roiData[2].D);
}
break;
case "ROILine":
if (m_roiData != null)
{
this._roiController.displayLine(roi.Color, m_roiData[0].D, m_roiData[1].D, m_roiData[2].D, m_roiData[3].D);
}
break;
default:
break;
}
}
}
public void removeActiveROI(ref List<Model.ROI> rois)
{
this._roiController.removeActiveROI(ref rois);
}
public void setActiveRoi(int index)
{
this._roiController.activeROIidx = index;
}
public void saveROI(List<Model.ROI> rois, string fileNmae)
{
List<Model.RoiData> m_RoiData = new List<Model.RoiData>();
for (int i = 0; i < rois.Count; i++)
{
m_RoiData.Add(new Model.RoiData(i, rois[i]));
}
Config.SerializeHelper.Save(m_RoiData, fileNmae);
}
public void loadROI(string fileName, out List<Model.ROI> rois)
{
rois = new List<Model.ROI>();
List<Model.RoiData> m_RoiData = new List<Model.RoiData>();
m_RoiData = (List<Model.RoiData>)Config.SerializeHelper.Load(m_RoiData.GetType(), fileName);
for (int i = 0; i < m_RoiData.Count; i++)
{
switch (m_RoiData[i].Name)
{
case "Rectangle1":
this._roiController.genRect1(m_RoiData[i].Rectangle1.Row1, m_RoiData[i].Rectangle1.Column1,
m_RoiData[i].Rectangle1.Row2, m_RoiData[i].Rectangle1.Column2, ref rois);
rois.Last().Color = m_RoiData[i].Rectangle1.Color;
break;
case "Rectangle2":
this._roiController.genRect2(m_RoiData[i].Rectangle2.Row, m_RoiData[i].Rectangle2.Column,
m_RoiData[i].Rectangle2.Phi, m_RoiData[i].Rectangle2.Lenth1, m_RoiData[i].Rectangle2.Lenth2, ref rois);
rois.Last().Color = m_RoiData[i].Rectangle2.Color;
break;
case "Circle":
this._roiController.genCircle(m_RoiData[i].Circle.Row, m_RoiData[i].Circle.Column, m_RoiData[i].Circle.Radius, ref rois);
rois.Last().Color = m_RoiData[i].Circle.Color;
break;
case "Line":
this._roiController.genLine(m_RoiData[i].Line.RowBegin, m_RoiData[i].Line.ColumnBegin,
m_RoiData[i].Line.RowEnd, m_RoiData[i].Line.ColumnEnd, ref rois);
rois.Last().Color = m_RoiData[i].Line.Color;
break;
default:
break;
}
}
this._hWndControl.resetAll();
this._hWndControl.repaint();
}
#region region xld的方法
public void displayHobject(HObject obj,string color)
{
_hWndControl.DispObj(obj, color);
}
public void displayHobject(HObject obj)
{
_hWndControl.DispObj(obj, null);
}
#endregion
}
}

3
ImageWindow/app.config Normal file
View File

@@ -0,0 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,172 @@
<?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:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="m_CtrlImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="m_CtrlImageList.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADk
CAAAAk1TRnQBSQFMAgEBAgEAAbABAAGwAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm
AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM
AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA
ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz
AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ
AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM
AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA
AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA
AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ
AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/
AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA
AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm
ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ
Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz
AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA
AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM
AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM
ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM
Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA
AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM
AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ
AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz
AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm
AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw
AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/4IAAbwB9wPvAZID7wHt
A+8B6gIAAQcB6wpyAesBFSIAAbwB8wL/AfQB8QP/AQcD/wHqAgABBwyYAREiAAG8AfMC/wH0AfED/wEH
A/8B6gIAAQcGmAF4AZgCmQKYAREiAAG8AQcD8AG8A/ABBwPwAeoCAAEHAfACeAKYAXgBCAH2BP8BFSIA
AbwB8gL0AfMB8QL0Af8BBwH/AfQB/wHqAgABBwH/AfMDCAHzBv8BFCIAAbwB8wL/AfQB8QP/AQcD/wHq
AgABBwf/AcMBWQGaAv8BFCIAAbwB8gL0AfMB8QL0Af8BBwH/AfQB/wHqAgABBwf/AZoB/wHDAZoB/wEU
IgABvAEHA/ABvAPwAQcD8AHqAgABBwb/AfYBGgH/AfYBegH/ARQiAAG8AfMC/wH0AfED/wEHA/8B6gIA
AQcH/wEaApoBwwH/ARQiAAG8AfMC/wH0AfED/wEHA/8B6gIAAQcM/wEUIgABvAH3A+8BkgPvAe0D7wHq
AgABBwz3ARThAAFCAU0BPgcAAT4DAAEoAwABQAMAARADAAEBAQABAQUAAYAXAAP/AQAE/wQABP8EAAGA
AQEBgAEBBAABgAEBAYABAQQAAYABAQGAAQEEAAGAAQEBgAEBBAABgAEBAYABAQQAAYABAQGAAQEEAAGA
AQEBgAEBBAABgAEBAYABAQQAAYABAQGAAQEEAAGAAQEBgAEBBAABgAEBAYABAQQABP8EAAT/BAAE/wQA
Cw==
</value>
</data>
<metadata name="mCtrl_HWindow.LayoutBitmap" type="System.Resources.ResXNullRef, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value />
</metadata>
</root>

Binary file not shown.

View File

@@ -0,0 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,9 @@
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\bin\Debug\HWindow_Tool.dll.config
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\bin\Debug\HWindow_Tool.dll
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\bin\Debug\HWindow_Tool.pdb
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\obj\Debug\4 HWindow_Tool.csprojResolveAssemblyReference.cache
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\obj\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\obj\Debug\ViewROI.Properties.Resources.resources
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\obj\Debug\4 HWindow_Tool.csproj.GenerateResource.Cache
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\obj\Debug\HWindow_Tool.dll
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\obj\Debug\HWindow_Tool.pdb

View File

@@ -0,0 +1,21 @@
D:\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\HWindow_Tool.dll.config
D:\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\HWindow_Tool.dll
D:\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\HWindow_Tool.pdb
D:\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\halcondotnet.dll
D:\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\halcondotnet.xml
D:\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\Debug\HWindow_Tool.csprojResolveAssemblyReference.cache
D:\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
D:\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\Debug\ViewROI.Properties.Resources.resources
D:\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\Debug\HWindow_Tool.csproj.GenerateResource.Cache
D:\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\Debug\HWindow_Tool.dll
D:\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\Debug\HWindow_Tool.pdb
C:\Users\dsh\Desktop\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
C:\Users\dsh\Desktop\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\Debug\ViewROI.Properties.Resources.resources
C:\Users\dsh\Desktop\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\Debug\HWindow_Tool.csproj.GenerateResource.Cache
C:\Users\dsh\Desktop\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\Debug\HWindow_Tool.dll
C:\Users\dsh\Desktop\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\Debug\HWindow_Tool.pdb
C:\Users\dsh\Desktop\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\HWindow_Tool.dll.config
C:\Users\dsh\Desktop\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\HWindow_Tool.dll
C:\Users\dsh\Desktop\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\HWindow_Tool.pdb
C:\Users\dsh\Desktop\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\halcondotnet.dll
C:\Users\dsh\Desktop\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\halcondotnet.xml

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,6 @@
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\obj\x64\Debug\4 HWindow_Tool.csprojResolveAssemblyReference.cache
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\obj\x64\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\obj\x64\Debug\ViewROI.Properties.Resources.resources
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\obj\x64\Debug\4 HWindow_Tool.csproj.GenerateResource.Cache
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\obj\x64\Debug\HWindow_Tool.dll
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\obj\x64\Debug\HWindow_Tool.pdb

View File

@@ -0,0 +1,29 @@
C:\Documents and Settings\Administrator\My Documents\桌面\ihalcon开源窗体控件\halcon控件\bin\x64\Debug\HWindow_Tool.dll.config
C:\Documents and Settings\Administrator\My Documents\桌面\ihalcon开源窗体控件\halcon控件\bin\x64\Debug\HWindow_Tool.dll
C:\Documents and Settings\Administrator\My Documents\桌面\ihalcon开源窗体控件\halcon控件\bin\x64\Debug\HWindow_Tool.pdb
C:\Documents and Settings\Administrator\My Documents\桌面\ihalcon开源窗体控件\halcon控件\obj\x64\Debug\ResolveAssemblyReference.cache
C:\Documents and Settings\Administrator\My Documents\桌面\ihalcon开源窗体控件\halcon控件\obj\x64\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
C:\Documents and Settings\Administrator\My Documents\桌面\ihalcon开源窗体控件\halcon控件\obj\x64\Debug\ViewROI.Properties.Resources.resources
C:\Documents and Settings\Administrator\My Documents\桌面\ihalcon开源窗体控件\halcon控件\obj\x64\Debug\HWindow_Tool.csproj.GenerateResource.Cache
C:\Documents and Settings\Administrator\My Documents\桌面\ihalcon开源窗体控件\halcon控件\obj\x64\Debug\HWindow_Tool.dll
C:\Documents and Settings\Administrator\My Documents\桌面\ihalcon开源窗体控件\halcon控件\obj\x64\Debug\HWindow_Tool.pdb
E:\编程工具\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\x64\Debug\HWindow_Tool.dll.config
E:\编程工具\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\x64\Debug\HWindow_Tool.dll
E:\编程工具\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\x64\Debug\HWindow_Tool.pdb
E:\编程工具\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\x64\Debug\halcondotnet.dll
E:\编程工具\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\x64\Debug\halcondotnet.xml
E:\编程工具\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\x64\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
E:\编程工具\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\x64\Debug\ViewROI.Properties.Resources.resources
E:\编程工具\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\x64\Debug\HWindow_Tool.csproj.GenerateResource.Cache
E:\编程工具\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\x64\Debug\HWindow_Tool.dll
E:\编程工具\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\x64\Debug\HWindow_Tool.pdb
D:\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\x64\Debug\HWindow_Tool.dll.config
D:\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\x64\Debug\HWindow_Tool.dll
D:\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\x64\Debug\HWindow_Tool.pdb
D:\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\x64\Debug\halcondotnet.dll
D:\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\x64\Debug\halcondotnet.xml
D:\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\x64\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
D:\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\x64\Debug\ViewROI.Properties.Resources.resources
D:\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\x64\Debug\HWindow_Tool.csproj.GenerateResource.Cache
D:\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\x64\Debug\HWindow_Tool.dll
D:\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\x64\Debug\HWindow_Tool.pdb

Binary file not shown.

Binary file not shown.

View File

View File

@@ -0,0 +1,66 @@
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.6\ImageWindow\bin\Debug\HWindow_Tool.dll.config
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.6\ImageWindow\bin\Debug\HWindow_Tool.dll
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.6\ImageWindow\bin\Debug\HWindow_Tool.pdb
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.6\ImageWindow\bin\Debug\halcondotnet.dll
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.6\ImageWindow\bin\Debug\halcondotnet.xml
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.6\ImageWindow\obj\x86\Debug\4 HWindow_Tool.csprojResolveAssemblyReference.cache
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.6\ImageWindow\obj\x86\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.6\ImageWindow\obj\x86\Debug\ViewROI.Properties.Resources.resources
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.6\ImageWindow\obj\x86\Debug\4 HWindow_Tool.csproj.GenerateResource.Cache
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.6\ImageWindow\obj\x86\Debug\HWindow_Tool.dll
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.6\ImageWindow\obj\x86\Debug\HWindow_Tool.pdb
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.7\ImageWindow\bin\Debug\HWindow_Tool.dll.config
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.7\ImageWindow\bin\Debug\HWindow_Tool.dll
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.7\ImageWindow\bin\Debug\HWindow_Tool.pdb
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.7\ImageWindow\bin\Debug\halcondotnet.dll
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.7\ImageWindow\bin\Debug\halcondotnet.xml
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.7\ImageWindow\obj\x86\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.7\ImageWindow\obj\x86\Debug\ViewROI.Properties.Resources.resources
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.7\ImageWindow\obj\x86\Debug\4 HWindow_Tool.csproj.GenerateResource.Cache
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.7\ImageWindow\obj\x86\Debug\HWindow_Tool.dll
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.7\ImageWindow\obj\x86\Debug\HWindow_Tool.pdb
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.4\ImageWindow\bin\Debug\HWindow_Tool.dll.config
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.4\ImageWindow\bin\Debug\HWindow_Tool.dll
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.4\ImageWindow\bin\Debug\HWindow_Tool.pdb
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.4\ImageWindow\bin\Debug\halcondotnet.dll
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.4\ImageWindow\bin\Debug\halcondotnet.xml
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.4\ImageWindow\obj\x86\Debug\4 HWindow_Tool.csprojResolveAssemblyReference.cache
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.4\ImageWindow\obj\x86\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.4\ImageWindow\obj\x86\Debug\ViewROI.Properties.Resources.resources
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.4\ImageWindow\obj\x86\Debug\4 HWindow_Tool.csproj.GenerateResource.Cache
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.4\ImageWindow\obj\x86\Debug\HWindow_Tool.dll
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.4\ImageWindow\obj\x86\Debug\HWindow_Tool.pdb
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.5\ImageWindow\bin\Debug\HWindow_Tool.dll.config
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.5\ImageWindow\bin\Debug\HWindow_Tool.dll
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.5\ImageWindow\bin\Debug\HWindow_Tool.pdb
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.5\ImageWindow\bin\Debug\halcondotnet.dll
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.5\ImageWindow\bin\Debug\halcondotnet.xml
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.5\ImageWindow\obj\x86\Debug\4 HWindow_Tool.csprojResolveAssemblyReference.cache
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.5\ImageWindow\obj\x86\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.5\ImageWindow\obj\x86\Debug\ViewROI.Properties.Resources.resources
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.5\ImageWindow\obj\x86\Debug\4 HWindow_Tool.csproj.GenerateResource.Cache
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.5\ImageWindow\obj\x86\Debug\HWindow_Tool.dll
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.5\ImageWindow\obj\x86\Debug\HWindow_Tool.pdb
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.3\ImageWindow\bin\Debug\HWindow_Tool.dll.config
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.3\ImageWindow\bin\Debug\HWindow_Tool.dll
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.3\ImageWindow\bin\Debug\HWindow_Tool.pdb
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.3\ImageWindow\bin\Debug\halcondotnet.dll
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.3\ImageWindow\bin\Debug\halcondotnet.xml
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.3\ImageWindow\obj\x86\Debug\4 HWindow_Tool.csprojResolveAssemblyReference.cache
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.3\ImageWindow\obj\x86\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.3\ImageWindow\obj\x86\Debug\ViewROI.Properties.Resources.resources
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.3\ImageWindow\obj\x86\Debug\4 HWindow_Tool.csproj.GenerateResource.Cache
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.3\ImageWindow\obj\x86\Debug\HWindow_Tool.dll
C:\Users\李康\Desktop\My Projects\5 Vision & Motion Pro\VisionAndMotionPro V1.0.0.3\ImageWindow\obj\x86\Debug\HWindow_Tool.pdb
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\bin\Debug\HWindow_Tool.dll.config
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\bin\Debug\HWindow_Tool.dll
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\bin\Debug\HWindow_Tool.pdb
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\obj\x86\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\obj\x86\Debug\ViewROI.Properties.Resources.resources
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\obj\x86\Debug\4 HWindow_Tool.csproj.GenerateResource.Cache
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\obj\x86\Debug\HWindow_Tool.dll
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\obj\x86\Debug\HWindow_Tool.pdb
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\bin\Debug\HWindow_Final.resx
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\bin\Debug\HWindow_Final.cs
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\bin\Debug\HWindow_Final.designer.cs
E:\VisionAndMotionPro V0.0.0.3\VisionAndMotionPro V0.0.0.3\ImageWindow\obj\x86\Debug\4 HWindow_Tool.csprojResolveAssemblyReference.cache

View File

@@ -0,0 +1,157 @@
C:\Users\Administrator\Desktop\temp\测试ViewROI\bin\Debug\HWindow_Tool.dll.config
C:\Users\Administrator\Desktop\temp\测试ViewROI\bin\Debug\HWindow_Tool.dll
C:\Users\Administrator\Desktop\temp\测试ViewROI\bin\Debug\HWindow_Tool.pdb
C:\Users\Administrator\Desktop\temp\测试ViewROI\bin\Debug\halcondotnet.dll
C:\Users\Administrator\Desktop\temp\测试ViewROI\bin\Debug\halcondotnet.xml
C:\Users\Administrator\Desktop\temp\测试ViewROI\obj\x86\Debug\ViewROI.Form1.resources
C:\Users\Administrator\Desktop\temp\测试ViewROI\obj\x86\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
C:\Users\Administrator\Desktop\temp\测试ViewROI\obj\x86\Debug\ViewROI.Properties.Resources.resources
C:\Users\Administrator\Desktop\temp\测试ViewROI\obj\x86\Debug\HWindow_Tool.csproj.GenerateResource.Cache
C:\Users\Administrator\Desktop\temp\测试ViewROI\obj\x86\Debug\HWindow_Tool.dll
C:\Users\Administrator\Desktop\temp\测试ViewROI\obj\x86\Debug\HWindow_Tool.pdb
E:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\obj\x86\Debug\ViewROI.Form1.resources
E:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\obj\x86\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
E:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\obj\x86\Debug\ViewROI.Properties.Resources.resources
E:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.csproj.GenerateResource.Cache
E:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.dll
E:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\bin\Debug\HWindow_Tool.dll.config
E:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\bin\Debug\HWindow_Tool.dll
E:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\bin\Debug\HWindow_Tool.pdb
E:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\bin\Debug\halcondotnet.dll
E:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\bin\Debug\halcondotnet.xml
E:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.pdb
C:\Users\Administrator\Desktop\temp\HWindow控件\测试ViewROI\bin\Debug\HWindow_Tool.dll.config
C:\Users\Administrator\Desktop\temp\HWindow控件\测试ViewROI\bin\Debug\HWindow_Tool.dll
C:\Users\Administrator\Desktop\temp\HWindow控件\测试ViewROI\bin\Debug\HWindow_Tool.pdb
C:\Users\Administrator\Desktop\temp\HWindow控件\测试ViewROI\bin\Debug\halcondotnet.dll
C:\Users\Administrator\Desktop\temp\HWindow控件\测试ViewROI\bin\Debug\halcondotnet.xml
C:\Users\Administrator\Desktop\temp\HWindow控件\测试ViewROI\obj\x86\Debug\ViewROI.Form1.resources
C:\Users\Administrator\Desktop\temp\HWindow控件\测试ViewROI\obj\x86\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
C:\Users\Administrator\Desktop\temp\HWindow控件\测试ViewROI\obj\x86\Debug\ViewROI.Properties.Resources.resources
C:\Users\Administrator\Desktop\temp\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.csproj.GenerateResource.Cache
C:\Users\Administrator\Desktop\temp\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.dll
C:\Users\Administrator\Desktop\temp\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.pdb
E:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.csprojResolveAssemblyReference.cache
H:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\bin\Debug\HWindow_Tool.dll.config
H:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\bin\Debug\HWindow_Tool.dll
H:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\bin\Debug\HWindow_Tool.pdb
H:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\bin\Debug\halcondotnet.dll
H:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\bin\Debug\halcondotnet.xml
H:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\obj\x86\Debug\ViewROI.Form1.resources
H:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\obj\x86\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
H:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\obj\x86\Debug\ViewROI.Properties.Resources.resources
H:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.csproj.GenerateResource.Cache
H:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.dll
H:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.pdb
G:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\bin\Debug\HWindow_Tool.dll.config
G:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\bin\Debug\HWindow_Tool.dll
G:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\bin\Debug\HWindow_Tool.pdb
G:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\bin\Debug\halcondotnet.dll
G:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\bin\Debug\halcondotnet.xml
G:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\obj\x86\Debug\ViewROI.Form1.resources
G:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\obj\x86\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
G:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\obj\x86\Debug\ViewROI.Properties.Resources.resources
G:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.csproj.GenerateResource.Cache
G:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.dll
G:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.pdb
G:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.csprojResolveAssemblyReference.cache
H:\1vsProjec\0lq\LQ-辅料定位\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.csprojResolveAssemblyReference.cache
G:\1vsProjec\0lq\HWindow控件\测试ViewROI\bin\Debug\HWindow_Tool.dll.config
G:\1vsProjec\0lq\HWindow控件\测试ViewROI\bin\Debug\HWindow_Tool.dll
G:\1vsProjec\0lq\HWindow控件\测试ViewROI\bin\Debug\HWindow_Tool.pdb
G:\1vsProjec\0lq\HWindow控件\测试ViewROI\bin\Debug\halcondotnet.xml
G:\1vsProjec\0lq\HWindow控件\测试ViewROI\obj\x86\Debug\ViewROI.Form1.resources
G:\1vsProjec\0lq\HWindow控件\测试ViewROI\obj\x86\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
G:\1vsProjec\0lq\HWindow控件\测试ViewROI\obj\x86\Debug\ViewROI.Properties.Resources.resources
G:\1vsProjec\0lq\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.csproj.GenerateResource.Cache
G:\1vsProjec\0lq\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.dll
G:\1vsProjec\0lq\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.pdb
G:\1vsProjec\0lq\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.csprojResolveAssemblyReference.cache
H:\1vsProjec\0lq\HWindow控件\测试ViewROI\bin\Debug\HWindow_Tool.dll.config
H:\1vsProjec\0lq\HWindow控件\测试ViewROI\bin\Debug\HWindow_Tool.dll
H:\1vsProjec\0lq\HWindow控件\测试ViewROI\bin\Debug\HWindow_Tool.pdb
H:\1vsProjec\0lq\HWindow控件\测试ViewROI\bin\Debug\halcondotnet.dll
H:\1vsProjec\0lq\HWindow控件\测试ViewROI\bin\Debug\halcondotnet.xml
H:\1vsProjec\0lq\HWindow控件\测试ViewROI\obj\x86\Debug\ViewROI.Form1.resources
H:\1vsProjec\0lq\HWindow控件\测试ViewROI\obj\x86\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
H:\1vsProjec\0lq\HWindow控件\测试ViewROI\obj\x86\Debug\ViewROI.Properties.Resources.resources
H:\1vsProjec\0lq\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.csproj.GenerateResource.Cache
H:\1vsProjec\0lq\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.dll
H:\1vsProjec\0lq\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.pdb
H:\1vsProjec\0lq\HWindow控件\测试ViewROI\obj\x86\Debug\HWindow_Tool.csprojResolveAssemblyReference.cache
G:\1vsProjec\1动态脚本\halcon窗体控件\bin\Debug\HWindow_Tool.dll.config
G:\1vsProjec\1动态脚本\halcon窗体控件\bin\Debug\HWindow_Tool.dll
G:\1vsProjec\1动态脚本\halcon窗体控件\bin\Debug\HWindow_Tool.pdb
G:\1vsProjec\1动态脚本\halcon窗体控件\bin\Debug\halcondotnet.dll
G:\1vsProjec\1动态脚本\halcon窗体控件\bin\Debug\halcondotnet.xml
G:\1vsProjec\1动态脚本\halcon窗体控件\obj\x86\Debug\ViewROI.Form1.resources
G:\1vsProjec\1动态脚本\halcon窗体控件\obj\x86\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
G:\1vsProjec\1动态脚本\halcon窗体控件\obj\x86\Debug\ViewROI.Properties.Resources.resources
G:\1vsProjec\1动态脚本\halcon窗体控件\obj\x86\Debug\HWindow_Tool.csproj.GenerateResource.Cache
G:\1vsProjec\1动态脚本\halcon窗体控件\obj\x86\Debug\HWindow_Tool.dll
G:\1vsProjec\1动态脚本\halcon窗体控件\obj\x86\Debug\HWindow_Tool.pdb
H:\1vsProjec\1动态脚本\halcon窗体控件\bin\Debug\HWindow_Tool.dll.config
H:\1vsProjec\1动态脚本\halcon窗体控件\bin\Debug\HWindow_Tool.dll
H:\1vsProjec\1动态脚本\halcon窗体控件\bin\Debug\HWindow_Tool.pdb
H:\1vsProjec\1动态脚本\halcon窗体控件\bin\Debug\halcondotnet.dll
H:\1vsProjec\1动态脚本\halcon窗体控件\bin\Debug\halcondotnet.xml
H:\1vsProjec\1动态脚本\halcon窗体控件\obj\x86\Debug\ViewROI.Form1.resources
H:\1vsProjec\1动态脚本\halcon窗体控件\obj\x86\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
H:\1vsProjec\1动态脚本\halcon窗体控件\obj\x86\Debug\ViewROI.Properties.Resources.resources
H:\1vsProjec\1动态脚本\halcon窗体控件\obj\x86\Debug\HWindow_Tool.csproj.GenerateResource.Cache
H:\1vsProjec\1动态脚本\halcon窗体控件\obj\x86\Debug\HWindow_Tool.dll
H:\1vsProjec\1动态脚本\halcon窗体控件\obj\x86\Debug\HWindow_Tool.pdb
H:\1vsProjec\1动态脚本\halcon窗体控件\obj\x86\Debug\HWindow_Tool.csprojResolveAssemblyReference.cache
H:\1vsProjec\1动态脚本\ihalcon开源窗体控件\bin\Debug\HWindow_Tool.exe.config
H:\1vsProjec\1动态脚本\ihalcon开源窗体控件\obj\x86\Debug\HWindow_Tool.pdb
H:\1vsProjec\1动态脚本\ihalcon开源窗体控件\bin\Debug\HWindow_Tool.exe
H:\1vsProjec\1动态脚本\ihalcon开源窗体控件\bin\Debug\HWindow_Tool.pdb
H:\1vsProjec\1动态脚本\ihalcon开源窗体控件\bin\Debug\halcondotnet.dll
H:\1vsProjec\1动态脚本\ihalcon开源窗体控件\bin\Debug\halcondotnet.xml
H:\1vsProjec\1动态脚本\ihalcon开源窗体控件\obj\x86\Debug\ViewROI.Form1.resources
H:\1vsProjec\1动态脚本\ihalcon开源窗体控件\obj\x86\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
H:\1vsProjec\1动态脚本\ihalcon开源窗体控件\obj\x86\Debug\ViewROI.Properties.Resources.resources
H:\1vsProjec\1动态脚本\ihalcon开源窗体控件\obj\x86\Debug\HWindow_Tool.csproj.GenerateResource.Cache
H:\1vsProjec\1动态脚本\ihalcon开源窗体控件\obj\x86\Debug\HWindow_Tool.exe
H:\1vsProjec\1动态脚本\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\HWindow_Tool.pdb
H:\1vsProjec\1动态脚本\ihalcon开源窗体控件\halcon控件\bin\Debug\HWindow_Tool.dll.config
H:\1vsProjec\1动态脚本\ihalcon开源窗体控件\halcon控件\bin\Debug\HWindow_Tool.dll
H:\1vsProjec\1动态脚本\ihalcon开源窗体控件\halcon控件\bin\Debug\HWindow_Tool.pdb
H:\1vsProjec\1动态脚本\ihalcon开源窗体控件\halcon控件\bin\Debug\halcondotnet.dll
H:\1vsProjec\1动态脚本\ihalcon开源窗体控件\halcon控件\bin\Debug\halcondotnet.xml
H:\1vsProjec\1动态脚本\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
H:\1vsProjec\1动态脚本\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\ViewROI.Properties.Resources.resources
H:\1vsProjec\1动态脚本\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\HWindow_Tool.csproj.GenerateResource.Cache
H:\1vsProjec\1动态脚本\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\HWindow_Tool.dll
E:\halcon平移缩放\C#源码\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\HWindow_Tool.csprojResolveAssemblyReference.cache
E:\halcon平移缩放\C#源码\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
E:\halcon平移缩放\C#源码\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\ViewROI.Properties.Resources.resources
E:\halcon平移缩放\C#源码\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\HWindow_Tool.csproj.GenerateResource.Cache
E:\halcon平移缩放\C#源码\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\HWindow_Tool.dll
E:\halcon平移缩放\C#源码\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\HWindow_Tool.pdb
E:\halcon平移缩放\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\HWindow_Tool.dll.config
E:\halcon平移缩放\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\HWindow_Tool.dll
E:\halcon平移缩放\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\HWindow_Tool.pdb
E:\halcon平移缩放\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\halcondotnet.dll
E:\halcon平移缩放\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\halcondotnet.xml
E:\编程工具\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\HWindow_Tool.dll.config
E:\编程工具\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\HWindow_Tool.dll
E:\编程工具\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\HWindow_Tool.pdb
E:\编程工具\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\halcondotnet.dll
E:\编程工具\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\halcondotnet.xml
E:\编程工具\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
E:\编程工具\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\ViewROI.Properties.Resources.resources
E:\编程工具\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\HWindow_Tool.csproj.GenerateResource.Cache
E:\编程工具\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\HWindow_Tool.dll
E:\编程工具\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\HWindow_Tool.pdb
C:\Users\dsh\Desktop\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\HWindow_Tool.dll.config
C:\Users\dsh\Desktop\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\HWindow_Tool.dll
C:\Users\dsh\Desktop\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\HWindow_Tool.pdb
C:\Users\dsh\Desktop\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\halcondotnet.dll
C:\Users\dsh\Desktop\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\bin\Debug\halcondotnet.xml
C:\Users\dsh\Desktop\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\ChoiceTech.Halcon.Control.HWindow_Final.resources
C:\Users\dsh\Desktop\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\ViewROI.Properties.Resources.resources
C:\Users\dsh\Desktop\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\HWindow_Tool.csproj.GenerateResource.Cache
C:\Users\dsh\Desktop\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\HWindow_Tool.dll
C:\Users\dsh\Desktop\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\HWindow_Tool.pdb
C:\Users\dsh\Desktop\halcon平移缩放(halcon1712)\C#源码\ihalcon开源窗体控件\halcon控件\obj\x86\Debug\HWindow_Tool.csprojResolveAssemblyReference.cache

Binary file not shown.

Binary file not shown.