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)的更多相关文章

  1. zw版【转发·台湾nvp系列Delphi例程】HALCON HImage与Bitmap格式转换

    zw版[转发·台湾nvp系列Delphi例程]HALCON HImage与Bitmap格式转换 (Delphi Prism)namespace HImage_Bitmap_Prism;interfac ...

  2. zw版【转发·台湾nvp系列Delphi例程】.NET调用HALCON COM控件内存释放模式

    zw版[转发·台湾nvp系列Delphi例程].NET调用HALCON COM控件内存释放模式 ------------------------------------方法一 :Imports Sys ...

  3. zw版【转发·台湾nvp系列Delphi例程】HALCON HWindow Overlayer 1

    zw版[转发·台湾nvp系列Delphi例程]HALCON HWindow Overlayer 1 ------------------------------------HALCON HWindow ...

  4. zw版【转发·台湾nvp系列Delphi例程】HALCON DirectFile

    zw版[转发·台湾nvp系列Delphi例程]HALCON DirectFile unit Unit1;interfaceuses Windows, Messages, SysUtils, Varia ...

  5. zw版【转发·台湾nvp系列Delphi例程】HALCON DirectShow

    zw版[转发·台湾nvp系列Delphi例程]HALCON DirectShow unit Unit1;interfaceuses Windows, Messages, SysUtils, Varia ...

  6. zw版【转发·台湾nvp系列Delphi例程】Delphi 使用 HALCON库件COM控件数据格式转换

    zw版[转发·台湾nvp系列Delphi例程]Delphi 使用 HALCON库件COM控件数据格式转换 Delphi 使用 HALCON库件COM控件数据格式转换,与IHObjectX接口有关 va ...

  7. zw版【转发·台湾nvp系列Delphi例程】HALCON AddNoiseWhite

    zw版[转发·台湾nvp系列Delphi例程]HALCON AddNoiseWhite unit Unit1;interfaceuses Windows, Messages, SysUtils, Va ...

  8. zw版【转发·台湾nvp系列Delphi例程】HALCON CheckDifference

    zw版[转发·台湾nvp系列Delphi例程]HALCON CheckDifference unit Unit1;interfaceuses Windows, Messages, SysUtils, ...

  9. zw版【转发·台湾nvp系列Delphi例程】HALCON BinThreshold

    zw版[转发·台湾nvp系列Delphi例程]HALCON BinThreshold unit Unit1;interfaceuses Windows, Messages, SysUtils, Var ...

随机推荐

  1. To do

    小事{ android values public.xml 树.图的所有遍历方式和优劣 } 大事{ 通读android所有官网文档. android多dex多res开发框架. java AOT(and ...

  2. 说说怎么写clean code

    前两天参加了公司组织的一个培训,主题是“如何写出好的代码” ,刚看到这个主题,第一反应是又不知道是哪个培训机构来忽悠钱的!老大安排了,就去听听呗. 说实在的,课程内容没有什么新鲜的东西,就是讲讲如何发 ...

  3. ArcGIS中利用ArcMap将地理坐标系转换成投影坐标系(从WKID=4326到WKID=102100)

    原文:ArcGIS中利用ArcMap将地理坐标系转换成投影坐标系(从WKID=4326到WKID=102100) 对于非地理专业的开发人员,对与这些生涩的概念,我们不一定都要了解,但是我们要理解,凡是 ...

  4. RTSP交互命令简介及过程参数描述

    目录 [hide] 1 RTSP消息格式 2 简单的rtsp交互过程 3 rtsp中常用方法 3.1 OPTION 3.2 DESCRIBE 3.3 SETUP 3.4 PLAY 3.5 PAUSE ...

  5. sql 显示0001

  6. HBASE架构解析(一)

    http://www.blogjava.net/DLevin/archive/2015/08/22/426877.html 前记 公司内部使用的是MapR版本的Hadoop生态系统,因而从MapR的官 ...

  7. 微信公众平台开发(98) UnionID

    关键字 微信公众平台 微信开放平台 UnionID作者:方倍工作室原文:http://www.cnblogs.com/txw1958/p/weixin98-get-user-UnionID.html ...

  8. C# 值类型和引用类型及参数传递

    值类型和引用类型: C#数据类型分为两大类:值类型和引用类型. 值类型数据主要有:结构体struct,枚举体enum,布尔型bool,浮点型,整型. 引用类型数据主要有:数组,字符串,接口,委托,类. ...

  9. 01 viewport

    <meta name="viewport" content="width=device-width,initial-scale=1.0">

  10. Java框架基础——反射(reflect)

    一.Class类的使用 1)在面向对象(oop)的世界里,万事万物皆对象. 在Java中,包括基本的数据类型,都是对象. Class c = int.class;//int 的类类型 那就是说: 类是 ...