Ai
2 Star 2 Fork 2

Strive.Zhang/AutoSearchMark

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ImageGrab.cs 1.85 KB
一键复制 编辑 原始数据 按行查看 历史
zl2002006 提交于 2017-10-26 21:19 +08:00 . Add files via upload
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HalconDotNet;
using System.Threading;
namespace HDevelop
{
class ImageGrab
{
//public HObject img = null;
public HObject ho_img;
private HTuple acqHandle;
//public double Y { get; set; }
//public double X { get; set; }
public ImageGrab()
{
//this.Y = y;
//this.X = x;
}
Thread th = null;
public void ShowImg()
{
HOperatorSet.OpenFramegrabber("DirectShow", 1, 1, 0, 0, 0, 0, "default", 8, "rgb",
-1, "false", "default", "0", -1, -1, out acqHandle);
HOperatorSet.GrabImageStart(acqHandle, -1);
th = new Thread(GrabImg);
th.IsBackground = true;
th.Start();
//else
//{
//}
}
public void CloseGrab()
{
if (th != null)
{
th.Abort();
}
HOperatorSet.CloseFramegrabber(acqHandle);
ho_img.Dispose();
}
//double a = 50;
//double b = 0;
void GrabImg()
{
//HWindow window = o as HWindow;
while (true)
{
//if (ho_img != null)
//{ ho_img.Dispose(); }
HOperatorSet.GrabImageAsync(out ho_img, acqHandle, -1);
//ho_img.Dispose();
//HOperatorSet.MirrorImage(ho_img, out ho_img, "column");
//HOperatorSet.DispObj(ho_img, window);
//ho_img = img;
//window.SetColor("sienna");
//window.DispCross(this.Y/2,this.X/2,1000,0);
}
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhangzheng10/AutoSearchMark.git
git@gitee.com:zhangzheng10/AutoSearchMark.git
zhangzheng10
AutoSearchMark
AutoSearchMark
master

搜索帮助