码迷,mamicode.com
首页 > Windows程序 > 详细

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

时间:2015-10-01 17:47:11      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:

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

技术分享
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleCtrls, HALCONXLib_TLB;
type
TForm1 = class(TForm)
HWindowXCtrl1: THWindowXCtrl;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
img : HImageX;
rg : HRegionX;
sys : HSystemX;
tp : HTupleX;
w, h : Integer;
begin
img := CoHImageX.Create;
rg := CoHRegionX.Create;
sys := CoHSystemX.Create;
tp := CoHTupleX.Create;
w := 512;
h := 512;
sys.SetSystem(‘width‘, w);
sys.SetSystem(‘height‘, h);
rg.GenRectangle1(tp.TupleConcat(60, 240), tp.TupleConcat(60, 240), tp.TupleConcat(200, 380), tp.TupleConcat(200, 380));
img.GenImageConst(‘byte‘, w, h);
img.OverpaintRegion(rg, tp.TupleConcat(255, 128), ‘fill‘);
HWindowXCtrl1.HalconWindow.SetPart(0, 0, h - 1, w - 1);
img.DispObj(HWindowXCtrl1.HalconWindow);
end;
end.

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

标签:

原文地址:http://www.cnblogs.com/ziwang/p/4851186.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!