Halcon 结合C#二次开发读取图片并处理图片 在Halcon12
0 中的程序编辑器编辑程序: read_image(Image,'E:/Tulips
jpg') get_image_size(Image,Width,Height) rgb1_to_gray(Image,GrayImage) 文件——导出 打开VS2010 新建项目 名称Window sFormsHalcon——确定 右键 Window sFormsHalcon——属性 更改目标框架为
NET Framew ork4 然后在“生成”选项下更改目标平台为Any CPU(其他均不用修改) 在工具箱栏右键——选择项 浏览— — 选 择 目 标 路 径 : C:\Program Files\MVTec\HALCON-12
0\bin\dotnet35选 择halcondotnet
dll——打开 出现如下界面——确定 在工具箱中出现控件 HWindow Control 在 Form1 窗体中拖入控件 HWindow Control,两个 Button 按钮控件,OpenFileDialog 控件 在VS2010 中打开之前导出的Halcon 程序,修改程序后写入窗体程序如下: using System; using System
Collections
Generic; using System
ComponentModel; using System
Data; using System
Drawing; using System
Linq; using System
Text; using System
Windows
Forms; using HalconDotNet; //添加引用HalconDotNet namespace WindowsFormsHalcon { public p