zw版【转发·台湾nvp系列Delphi例程】HALCON DirectShow (Delphi Prism)
zw版【转发·台湾nvp系列Delphi例程】HALCON DirectShow (Delphi Prism)
namespace DirectShow_Prism;
interface
uses
System.Drawing,
System.Collections,
System.Collections.Generic,
System.Windows.Forms,
System.ComponentModel,
HalconDotNet;
type
/// <summary>
/// Summary description for MainForm.
/// </summary>
MainForm = partial class(System.Windows.Forms.Form)
private
method MainForm_Load(sender: System.Object; e: System.EventArgs);
method MainForm_FormClosing(sender: System.Object; e: System.Windows.Forms.FormClosingEventArgs);
method timer1_Tick(sender: System.Object; e: System.EventArgs);
method button1_Click(sender: System.Object; e: System.EventArgs);
private
var fg: HFramegrabber := new HFramegrabber();
var img: HImage;
var mtype: String := '';
var w: System.Int32;
h: System.Int32;
protected
method Dispose(disposing: Boolean); override;
public
constructor;
end;
implementation
{$REGION Construction and Disposition}
constructor MainForm;
begin
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
end;
method MainForm.Dispose(disposing: Boolean);
begin
if disposing then begin
if assigned(components) then
components.Dispose();
//
// TODO: Add custom disposition code here
//
end;
inherited Dispose(disposing);
end;
{$ENDREGION}
method MainForm.MainForm_Load(sender: System.Object; e: System.EventArgs);
begin
fg.OpenFramegrabber(new HTuple('DirectShow'), new HTuple(1), new HTuple(1), new HTuple(0), new HTuple(0), new HTuple(0), new HTuple(0), new HTuple('default'), new HTuple(8), new HTuple('rgb'), new HTuple(-1), new HTuple('false'), new HTuple('default'), new HTuple('[1] ASUS USB2.0 Webcam'), new HTuple(0), new HTuple(-1))
end;
method MainForm.button1_Click(sender: System.Object; e: System.EventArgs);
begin
if button1.Text = 'Grab Start' then begin
button1.Text := 'Grab Stop';
timer1.Enabled := true
end
else begin
timer1.Enabled := false;
button1.Text := 'Grab Start'
end
end;
method MainForm.timer1_Tick(sender: System.Object; e: System.EventArgs);
begin
img := fg.GrabImage();
img.GetImagePointer1(out mtype, out w, out h);
hWindowControl1.HalconWindow.SetPart(0, 0, h - 1, w - 1);
hWindowControl1.HalconWindow.DispObj(img);
HOperatorSet.ClearObj(img);
//img.Dispose();
end;
method MainForm.MainForm_FormClosing(sender: System.Object; e: System.Windows.Forms.FormClosingEventArgs);
begin
timer1.Enabled := false;
fg.Dispose()
end;
end.
zw版【转发·台湾nvp系列Delphi例程】HALCON DirectShow (Delphi Prism)的更多相关文章
- zw版【转发·台湾nvp系列Delphi例程】HALCON HImage与Bitmap格式转换
zw版[转发·台湾nvp系列Delphi例程]HALCON HImage与Bitmap格式转换 (Delphi Prism)namespace HImage_Bitmap_Prism;interfac ...
- zw版【转发·台湾nvp系列Delphi例程】.NET调用HALCON COM控件内存释放模式
zw版[转发·台湾nvp系列Delphi例程].NET调用HALCON COM控件内存释放模式 ------------------------------------方法一 :Imports Sys ...
- zw版【转发·台湾nvp系列Delphi例程】HALCON HWindow Overlayer 1
zw版[转发·台湾nvp系列Delphi例程]HALCON HWindow Overlayer 1 ------------------------------------HALCON HWindow ...
- zw版【转发·台湾nvp系列Delphi例程】HALCON DirectFile
zw版[转发·台湾nvp系列Delphi例程]HALCON DirectFile unit Unit1;interfaceuses Windows, Messages, SysUtils, Varia ...
- zw版【转发·台湾nvp系列Delphi例程】HALCON DirectShow
zw版[转发·台湾nvp系列Delphi例程]HALCON DirectShow unit Unit1;interfaceuses Windows, Messages, SysUtils, Varia ...
- zw版【转发·台湾nvp系列Delphi例程】Delphi 使用 HALCON库件COM控件数据格式转换
zw版[转发·台湾nvp系列Delphi例程]Delphi 使用 HALCON库件COM控件数据格式转换 Delphi 使用 HALCON库件COM控件数据格式转换,与IHObjectX接口有关 va ...
- zw版【转发·台湾nvp系列Delphi例程】HALCON AddNoiseWhite
zw版[转发·台湾nvp系列Delphi例程]HALCON AddNoiseWhite unit Unit1;interfaceuses Windows, Messages, SysUtils, Va ...
- zw版【转发·台湾nvp系列Delphi例程】HALCON CheckDifference
zw版[转发·台湾nvp系列Delphi例程]HALCON CheckDifference unit Unit1;interfaceuses Windows, Messages, SysUtils, ...
- zw版【转发·台湾nvp系列Delphi例程】HALCON BinThreshold
zw版[转发·台湾nvp系列Delphi例程]HALCON BinThreshold unit Unit1;interfaceuses Windows, Messages, SysUtils, Var ...
随机推荐
- CentOS联网
虚拟机那里选择NAT模式 用vi /etc/sysconfig/network-scripts/ifcfg-eth0进到网卡文件修改ONBOOT=yes.意思是启动网卡 (注意在vi里,需要编辑时要按 ...
- oracle截取某个字符前面的字符串
已验证. 要求:A.数据库表中的一个字符串 可能含有"+" 例:ORC+001 也可能不含“+” B.要求如果该字符串含有“+”,则取“+”之前的字符 例:ORC+001 取ORC ...
- NAT123 解决80端口被封的问题
使用的服务器不知什么原因80端口无法使用了,好像是被封了,用的移动的固定IP,移动线路一直是不稳定 关键是移动的回答竟然是找不到哪里封的 是不是被屏蔽了,无奈使用了NAT123做处理.试了下还是管用. ...
- 通过SessionID和用户名来保证同一个用户不能同时登录(单点登录)
可以通过SessionID和用户名来保证同一个用户不能同时登录的问题,下面程序模仿了QQ的登录,当登录后判断当前帐号是否已经登录,如果登录.则踢掉以前登录的用户. 1.通过Application全局变 ...
- T4自动生成数据库C#实体类学习(1)
第一个测试的Demo <#@ template language="C#" debug="True" hostspecific="True&qu ...
- 注册页面的简单搭建(H5)
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- 继承Prototype实现语句不能写在动态原型法中的理解
阅读javascript高级编程中, 对动态原型法中写Prototype继承父类对象的不可行的现象,不甚理解. 书上说是技术原因,如下有问题代码: 但是把protype语句移到构造函数后面,就OK,如 ...
- asmdisk opened & asmdisk cached
ASMDISK OPENED - Disk is present in the storage system and is being accessed by Automatic Storage Ma ...
- javax.xml.ws.webserviceexception class do not have a property of the name
我是用wsimport生成webservice 的客户端,放到工程里,调用,出现这个异常, 后来发现,是没有把package-info.java这个文件一起放到包里的缘故 解决: 连同package- ...
- Effective C++ 1.让自己习惯C++
//条款01:视C++为一个语言联邦 // 1:C++主要包含的语言为: // A:C.说到底C++仍然以C为基础.区块(blocks).语句.预处理器.内置数据类型.数组.指针等均来自于C.许多时候 ...