• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

zw版【转发· 台@@湾 nvp系列Delphi例程】HALCON DirectShow (Delphi Prism) ...

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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.

QQ群 247994767(delphi与halcon) 【zw版《delphi与halcon系列原创教程》,网址,cnblogs.com/ziwang/ 】 QQ:2592439395(zw) , delphi+halcon,图像分析神级配置, 分分钟秒杀 c+opencv,python+opencv,c+matlab, 以及其他各种组合

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Matlab基础知识(2)—— matlab中矩阵的一些操作发布时间:2022-07-18
下一篇:
Matlab基础知识(2)—— 对矩阵的一些操作发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap