mirror of
https://github.com/eggplantlwj/VisionEdit.git
synced 2026-03-26 01:36:35 +08:00
修复了一些bug,降低插件之间耦合度
This commit is contained in:
69
HalconWindowTest/HWindowSmart.Designer.cs
generated
Normal file
69
HalconWindowTest/HWindowSmart.Designer.cs
generated
Normal file
@@ -0,0 +1,69 @@
|
||||
namespace HalconWindow
|
||||
{
|
||||
partial class HWindowSmart
|
||||
{
|
||||
/// <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();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region 组件设计器生成的代码
|
||||
|
||||
/// <summary>
|
||||
/// 设计器支持所需的方法 - 不要修改
|
||||
/// 使用代码编辑器修改此方法的内容。
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.hSmartWindowControl = new HalconDotNet.HSmartWindowControl();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// hSmartWindowControl
|
||||
//
|
||||
this.hSmartWindowControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.hSmartWindowControl.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.hSmartWindowControl.AutoValidate = System.Windows.Forms.AutoValidate.EnableAllowFocusChange;
|
||||
this.hSmartWindowControl.HDoubleClickToFitContent = true;
|
||||
this.hSmartWindowControl.HDrawingObjectsModifier = HalconDotNet.HSmartWindowControl.DrawingObjectsModifier.None;
|
||||
this.hSmartWindowControl.HImagePart = new System.Drawing.Rectangle(0, 0, 640, 480);
|
||||
this.hSmartWindowControl.HKeepAspectRatio = true;
|
||||
this.hSmartWindowControl.HMoveContent = true;
|
||||
this.hSmartWindowControl.HZoomContent = HalconDotNet.HSmartWindowControl.ZoomContent.WheelForwardZoomsIn;
|
||||
this.hSmartWindowControl.Location = new System.Drawing.Point(0, 0);
|
||||
this.hSmartWindowControl.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.hSmartWindowControl.Name = "hSmartWindowControl";
|
||||
this.hSmartWindowControl.Size = new System.Drawing.Size(652, 498);
|
||||
this.hSmartWindowControl.TabIndex = 0;
|
||||
this.hSmartWindowControl.WindowSize = new System.Drawing.Size(652, 498);
|
||||
//
|
||||
// HWindowSmart
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.hSmartWindowControl);
|
||||
this.Name = "HWindowSmart";
|
||||
this.Size = new System.Drawing.Size(652, 522);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public HalconDotNet.HSmartWindowControl hSmartWindowControl;
|
||||
}
|
||||
}
|
||||
20
HalconWindowTest/HWindowSmart.cs
Normal file
20
HalconWindowTest/HWindowSmart.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace HalconWindow
|
||||
{
|
||||
public partial class HWindowSmart : UserControl
|
||||
{
|
||||
public HWindowSmart()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
120
HalconWindowTest/HWindowSmart.resx
Normal file
120
HalconWindowTest/HWindowSmart.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -100,6 +100,12 @@
|
||||
<DependentUpon>HWindow_Final.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="HalconWindow\ViewWindow.cs" />
|
||||
<Compile Include="HWindowSmart.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="HWindowSmart.Designer.cs">
|
||||
<DependentUpon>HWindowSmart.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MainForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -111,6 +117,9 @@
|
||||
<EmbeddedResource Include="HalconWindow\HWindow_Final.resx">
|
||||
<DependentUpon>HWindow_Final.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="HWindowSmart.resx">
|
||||
<DependentUpon>HWindowSmart.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MainForm.resx">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
||||
@@ -55,8 +55,7 @@
|
||||
//
|
||||
// HWindow_Final
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.Controls.Add(this.m_CtrlHStatusLabelCtrl);
|
||||
this.Controls.Add(this.mCtrl_HWindow);
|
||||
this.Name = "HWindow_Final";
|
||||
|
||||
@@ -20,7 +20,6 @@ namespace HalconWindow.HalconWindow
|
||||
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
|
||||
@@ -44,7 +43,7 @@ namespace HalconWindow.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");
|
||||
// hv_window.SetMshape("Hourglass");
|
||||
|
||||
fit_strip = new ToolStripMenuItem("适应窗口");
|
||||
fit_strip.Click += new EventHandler((s, e) => DispImageFit(mCtrl_HWindow));
|
||||
@@ -108,19 +107,6 @@ namespace HalconWindow.HalconWindow
|
||||
drawModel = value;
|
||||
}
|
||||
}
|
||||
private bool _EditModel = true;//绘制的图形是否可以编辑
|
||||
public bool EditModel
|
||||
{
|
||||
get
|
||||
{
|
||||
return _EditModel;
|
||||
}
|
||||
set
|
||||
{
|
||||
viewWindow.setEditModel(value);
|
||||
_EditModel = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置image,初始化控件参数
|
||||
@@ -142,9 +128,7 @@ namespace HalconWindow.HalconWindow
|
||||
|
||||
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
|
||||
@@ -289,7 +273,7 @@ namespace HalconWindow.HalconWindow
|
||||
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);
|
||||
str_position = String.Format("ROW: {0:0000.0}, COLUMN: {1:0000.0}", positionY, positionX);
|
||||
|
||||
_isXOut = (positionX < 0 || positionX >= hv_imageWidth);
|
||||
_isYOut = (positionY < 0 || positionY >= hv_imageHeight);
|
||||
@@ -298,9 +282,9 @@ namespace HalconWindow.HalconWindow
|
||||
{
|
||||
if ((int)channel_count == 1)
|
||||
{
|
||||
int grayVal;
|
||||
double grayVal;
|
||||
grayVal = hv_image.GetGrayval((int)positionY, (int)positionX);
|
||||
str_value = String.Format("V: {0:000}", grayVal);
|
||||
str_value = String.Format("Val: {0:000.0}", grayVal);
|
||||
}
|
||||
else if ((int)channel_count == 3)
|
||||
{
|
||||
@@ -320,13 +304,13 @@ namespace HalconWindow.HalconWindow
|
||||
_GreenChannel.Dispose();
|
||||
_BlueChannel.Dispose();
|
||||
|
||||
str_value = String.Format("V: ({0:000.0}, {1:000.0}, {2:000.0})", grayValRed, grayValGreen, grayValBlue);
|
||||
str_value = String.Format("Val: ({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;
|
||||
m_CtrlHStatusLabelCtrl.Text = str_imgSize + " " + str_position + " " + str_value;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -416,6 +400,7 @@ namespace HalconWindow.HalconWindow
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -3,12 +3,13 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using HalconDotNet;
|
||||
using ViewWindow.Model;
|
||||
|
||||
namespace ViewWindow
|
||||
{
|
||||
public class ViewWindow : Model.IViewWindow
|
||||
{
|
||||
public Model.HWndCtrl _hWndControl;
|
||||
private Model.HWndCtrl _hWndControl;
|
||||
|
||||
private Model.ROIController _roiController;
|
||||
|
||||
@@ -36,11 +37,11 @@ namespace ViewWindow
|
||||
//清空roi容器,不让roi显示
|
||||
this._roiController.reset();
|
||||
//显示图片
|
||||
this._roiController.resetWindowImage();
|
||||
this._roiController.resetWindowImage();
|
||||
|
||||
|
||||
//this._hWndControl.resetWindow();
|
||||
// this._hWndControl.resetAll();
|
||||
// this._hWndControl.resetAll();
|
||||
//this._hWndControl.repaint();
|
||||
}
|
||||
public void notDisplayRoi()
|
||||
@@ -61,12 +62,6 @@ namespace ViewWindow
|
||||
{
|
||||
_hWndControl.drawModel = flag;
|
||||
}
|
||||
//是否开启编辑事件
|
||||
public void setEditModel(bool flag)
|
||||
{
|
||||
_roiController.EditModel = flag;
|
||||
// _hWndControl.drawModel = flag;
|
||||
}
|
||||
public void resetWindowImage()
|
||||
{
|
||||
this._hWndControl.resetWindow();
|
||||
@@ -107,10 +102,7 @@ namespace ViewWindow
|
||||
{
|
||||
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);
|
||||
@@ -118,10 +110,10 @@ namespace ViewWindow
|
||||
|
||||
public List<double> smallestActiveROI(out string name, out int index)
|
||||
{
|
||||
List<double> resual = this._roiController.smallestActiveROI(out name,out 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);
|
||||
@@ -133,10 +125,10 @@ namespace ViewWindow
|
||||
this._roiController.selectROI(index);
|
||||
}
|
||||
|
||||
public void selectROI( List<Model.ROI> rois, int index)
|
||||
public void selectROI(List<Model.ROI> rois, int index)
|
||||
{
|
||||
//this._roiController.selectROI(index);
|
||||
if ((rois.Count > index)&&(index>=0))
|
||||
if ((rois.Count > index) && (index >= 0))
|
||||
{
|
||||
this._hWndControl.resetAll();
|
||||
this._hWndControl.repaint();
|
||||
@@ -167,13 +159,6 @@ namespace ViewWindow
|
||||
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)
|
||||
@@ -215,7 +200,7 @@ namespace ViewWindow
|
||||
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":
|
||||
@@ -296,15 +281,20 @@ namespace ViewWindow
|
||||
}
|
||||
|
||||
#region 专门用于 显示region 和xld的方法
|
||||
public void displayHobject(HObject obj,string color)
|
||||
public void displayHobject(HObject obj, string color)
|
||||
{
|
||||
_hWndControl.DispObj(obj, color);
|
||||
|
||||
|
||||
}
|
||||
public void displayHobject(HObject obj)
|
||||
{
|
||||
_hWndControl.DispObj(obj, null);
|
||||
}
|
||||
|
||||
public void genCircularArc(double row, double col, double radius, double startPhi, double extentPhi, string direct, ref List<ROI> rois)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
24
HalconWindowTest/MainForm.Designer.cs
generated
24
HalconWindowTest/MainForm.Designer.cs
generated
@@ -30,18 +30,22 @@
|
||||
{
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.panel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Location = new System.Drawing.Point(27, 53);
|
||||
this.panel1.Controls.Add(this.label1);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(521, 501);
|
||||
this.panel1.Size = new System.Drawing.Size(807, 600);
|
||||
this.panel1.TabIndex = 0;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(600, 106);
|
||||
this.button1.Location = new System.Drawing.Point(597, 173);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(89, 57);
|
||||
this.button1.TabIndex = 1;
|
||||
@@ -49,6 +53,16 @@
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(747, 567);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(41, 12);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "label1";
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
@@ -57,8 +71,9 @@
|
||||
this.Controls.Add(this.button1);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Name = "MainForm";
|
||||
this.Text = "MainForm";
|
||||
this.Load += new System.EventHandler(this.MainForm_Load);
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
@@ -67,5 +82,6 @@
|
||||
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ namespace HalconWindow
|
||||
{
|
||||
public partial class MainForm : Form
|
||||
{
|
||||
HWindow_Final myWindow = new HWindow_Final();
|
||||
HWindowSmart myWindow = new HWindowSmart();
|
||||
public MainForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -23,13 +23,18 @@ namespace HalconWindow
|
||||
private void MainForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.panel1.Controls.Add(myWindow);
|
||||
myWindow.Dock = DockStyle.Fill;
|
||||
HObject image = new HObject();
|
||||
HOperatorSet.ReadImage(out image, @"G:\Outer_HB.bmp");
|
||||
myWindow.hSmartWindowControl.HalconWindow.DispObj(image);
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
HObject image = new HObject();
|
||||
HOperatorSet.ReadImage(out image, @"G:\Outer_HB.bmp");
|
||||
myWindow.HobjectToHimage(image);
|
||||
myWindow.hSmartWindowControl.HalconWindow.DispObj(image);
|
||||
// myWindow.HobjectToHimage(image);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
HalconWindowTest/obj/Debug/HalconWindow.HWindowSmart.resources
Normal file
BIN
HalconWindowTest/obj/Debug/HalconWindow.HWindowSmart.resources
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user