当前位置:网站首页>C # joint programming with Halcon
C # joint programming with Halcon
2022-04-22 18:59:00 【Rocks in the wind and rain】
Display images C# And Halcon Joint programming :
1、 call Halcon Image processing database , Is the call successful , It's using Halcon Image display control — Whether the image can be displayed correctly .
How to use it C# And Halcon Joint programming call Halcon Image display controls to display images .
1. establish C# project , establish Windows Forms application .
2. Quote in the project Halcon Of DLL file . Right click “ quote ”–“ Add reference 
2.1 eject Reference Manager Click below “ Browse ” Button . choice Halcon Installation directory halcondotnet.dll file , Click Add – determine .

3. add to halcon Image display control . Visual Studio Click... On the left side “ hold-all ”, Right click in the blank area , choice “ Options ”. stay ".NET Framework Components “ Click on the ” Browse “ Button , Also add the one just referenced halcondotnet.dll file .

4、 exception handling
4.1、fatal error C1083: Can't open include file : “Halcon.h”: No such file or directory
This document includes . But the compilation times are wrong . resolvent 1:debug Change the mode to release The pattern is good .
4.2、error MS8020 Build tools v140 cannot be found terms of settlement
take " project —— attribute —— Configuration properties —— routine —— Platform toolset ” Change the option to the one you use VS The option of version platform set is OK , If used VS2013, Change it to v120 Of ,v140 Should be VS2015/2017 Version of the platform toolset ; As shown in the figure below :


4.3 The following controls have been successfully added to the toolbox , But... Is not enabled in the activity designer

Current project .NET The target framework is too low . terms of settlement : Right click Project — Click on “ attribute ”– Enter return stroke “ Applications ”---- There is a... In the interface “ Target response framework ”, The default should be “.NETFramework 2”, Change to NET Framework 4 4.5 That's it .
4.4 No, halcon

DLL File placement :
(1) Under the project folder …/bin/Debug/
(2) In the system folder C:/WINDOWS/system32
The copy is shown in the figure below

5 ok
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;
using HalconDotNet;
namespace HalconWindows
{
public partial class Form1 : Form
{
HWindow win = null;
HImage image = null;
public Form1()
{
InitializeComponent();
win = hWindowControl1.HalconWindow;// The window is associated with the space
image = new HImage();// Instantiate variables
image.ReadImage(@"E:\halcon\HalconWindows\HalconWindows\metal-parts\bracket_tilted_01.png");
int width = 0;
int height = 0;
image.GetImageSize(out width, out height);
win.SetPart(0,0, height - 1, width - 1);
win.DispObj(image);
}
private void hWindowControl1_HMouseMove(object sender, HalconDotNet.HMouseEventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
error 1 error C1083: Can't open include file : “Halcon.h”: No such file or directory e:\halcon\modelmatchdemo\modelmatchdemo\HalconCpp.h 32 1 ModelMatchDemo
D:\Program Files\MVTec\HALCON-18.11-Progress\include
project – attribute –c+±- Additional attributes

版权声明
本文为[Rocks in the wind and rain]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204221850568110.html
边栏推荐
- Career planning of data analysts -- career anxiety and future development of data analysts
- 2022 simulated examination platform operation of loader driver (special type of work in construction) Certificate
- readline分析日志
- P1794 求解好多鱼问题
- 2020-09-08 remove comments from JS code
- Network security -- the use of burp suite packet capture tool
- nodejs文件操作
- 【CIcadplayer】进度条回调
- k9. Chapter 2: install kubernetes v1.0 based on binary package 20 -- basic environment configuration and kernel configuration (I)
- 蓝牙盾/颈椎按摩仪/迷你充电宝/探头温度记等,段码LCD液晶显示驱动IC-VK1088B QFN32 4*4超小体积,22seg*4com且可通过指令进入省电模式
猜你喜欢

错误 C4996 ‘fopen‘: This function or variable may be unsafe. Consider using fopen_s instead. To disabl

微星小飞机 性能监控设置

JSP learning (IX. filter, wildcard and cookie processing)

Error c4996 'fopen': this function or variable may be unsafe Consider using fopen_ s instead. To disabl

linux系统下redis相关问题
![[network security] duomics variable coverage vulnerability from white box test to actual combat](/img/cd/876cad6523e923d5aaada65beb54a2.png)
[network security] duomics variable coverage vulnerability from white box test to actual combat

STC current interrupt list of all series

每日AI前沿术语:绿色AI(Green AI)

系统分析师-论文写作 框架搭建
![[Luogu] p2372 yyy2015c01 challenge perimeter (BFS)](/img/80/cae4f93f5432450469a07fb6e6e7fc.png)
[Luogu] p2372 yyy2015c01 challenge perimeter (BFS)
随机推荐
一份数据满足所有数据场景?腾讯云数据湖解决方案及DLC内核技术介绍
Namespace usage in typescript
The sandbox has entered into cooperative relations with slipknot and knotfest to jointly build knotverse
Nat. Commun. |用于学习生成模型的神经编码框架
There are so many operation and maintenance tools, which one to choose? Follow me for three seconds
【最佳实践】巡检项:内容分发网络(CDN)开启URL鉴权
Jsonobject data guarantee order of fastjson
Take you to understand the principle of highly flexible spark architecture
每日AI前沿术语:绿色AI(Green AI)
Pattern machine template computer CAD free pattern drawing and format conversion software ps300b tutorial: general CAD drawing and pattern drawing of Japanese brother pattern machine DXF file transfer
It's fun to learn programming. Why don't you know where to start when you do a project alone?
Alibaba微服务组件Sentinel介绍
nodejs如何预防xss攻击
MacOS M1 使用 Homebrew 安装 Mysql
Question bank and answers for the retraining of excavator drivers (special types of construction work) in 2022
模块代码的类型描述文件
单片机红外模块知识分享,理论是日后实战的基础
server端密码加密
校园跑腿平台如何搭建?
Customs clearance script