2019-07-13 19:28:22 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
using System.Data;
|
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using System.Windows.Forms;
|
2019-08-04 21:51:40 +08:00
|
|
|
|
using HalconWindow.HalconWindow;
|
2019-08-09 20:52:17 +08:00
|
|
|
|
using HalconDotNet;
|
2019-07-13 19:28:22 +08:00
|
|
|
|
|
2019-08-04 21:51:40 +08:00
|
|
|
|
namespace HalconWindow
|
2019-07-13 19:28:22 +08:00
|
|
|
|
{
|
|
|
|
|
|
public partial class MainForm : Form
|
|
|
|
|
|
{
|
2019-09-27 18:26:27 +08:00
|
|
|
|
HWindowSmart myWindow = new HWindowSmart();
|
2019-07-13 19:28:22 +08:00
|
|
|
|
public MainForm()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void MainForm_Load(object sender, EventArgs e)
|
|
|
|
|
|
{
|
2019-08-09 20:52:17 +08:00
|
|
|
|
this.panel1.Controls.Add(myWindow);
|
2019-09-27 18:26:27 +08:00
|
|
|
|
myWindow.Dock = DockStyle.Fill;
|
|
|
|
|
|
HObject image = new HObject();
|
|
|
|
|
|
HOperatorSet.ReadImage(out image, @"G:\Outer_HB.bmp");
|
|
|
|
|
|
myWindow.hSmartWindowControl.HalconWindow.DispObj(image);
|
2019-08-09 20:52:17 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void button1_Click(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
HObject image = new HObject();
|
|
|
|
|
|
HOperatorSet.ReadImage(out image, @"G:\Outer_HB.bmp");
|
2019-09-27 18:26:27 +08:00
|
|
|
|
myWindow.hSmartWindowControl.HalconWindow.DispObj(image);
|
|
|
|
|
|
// myWindow.HobjectToHimage(image);
|
2019-07-13 19:28:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|