Chatper 10, solution_guide_i.pdf, Halcon 17.12
版 本 | 路 径 | 支持WPF | 支持Client Profiles |
---|---|---|---|
.NET Framework 2.0 | %HALCONROOT%\bin\dotnet20 | No | No |
.NET Framework 3.5 | %HALCONROOT%\bin\dotnet35 | Yes | No |
编程环境 | 代码 |
---|---|
C# | using HalconDotNet; |
VB .Net | Imports HalconDotNet |
C++/CLI | using namespace HalconDotNet; |
在 Windows Forms 中使用 HSmartWindowControl,在 WPF 中使用 HSmartWindowControlWPF。
// 添加鼠标滚轮事件的回调
private void WindowControl_Load(object sender, EventArgs e)
{
this.MouseWheel += my_MouseWheel;
}
// 发送鼠标相对坐标发给 HSmartWindowControl
private void my_MouseWheel(object sender, MouseEventArgs e)
{
Point pt = WindowControl.Location;
MouseEventArgs newe = new MouseEventArgs(e.Button, e.Clicks,
e.X - pt.X, e.Y - pt.Y, e.Delta);
WindowControl.HSmartWindowControl_MouseWheel(sender, newe);
}
Click
GotFocus, LostFocus
MouseEnter, MouseLeave, MouseHover
Resize, SizeChanged
KeyDown, KeyUp, KeyPress
draw_*
get_mbutton(_subpix)
get_mposition(_subpix)
WindowControl.HalconWindow.SetPart(0, 0, -2, -2);
WindowControl.SetFullImagePart(null);
WindowControl.HDisplayCurrentObject = new HImage("fabrik");
学习Halcon(一)——使用HALCON/.NET开发程序(一)
原文:https://www.cnblogs.com/octoberkey/p/14825596.html