zw版【转发·*nvp系列Delphi例程】HALCON OverpaintRegion2

zw版【转发·*nvp系列Delphi例程】HALCON OverpaintRegion2

zw版【转发·*nvp系列Delphi例程】HALCON OverpaintRegion2
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 : HUntypedObjectX;
rg : HUntypedObjectX;
op : HOperatorSetX;
tp : HTupleX;
w, h : OleVariant;
begin
op := CoHOperatorSetX.Create;
op.GenEmptyObj(img);
op.GenEmptyObj(rg);
tp := CoHTupleX.Create;
w := 512;
h := 512;
op.SetSystem('width', w);
op.SetSystem('height', h);
op.GenRectangle1(rg, tp.TupleConcat(60, 240), tp.TupleConcat(60, 240), tp.TupleConcat(200, 380), tp.TupleConcat(200, 380));
op.GenImageConst(img, 'byte', w, h);
op.OverpaintRegion(img, rg, tp.TupleConcat(128, 255), 'fill');
HWindowXCtrl1.HalconWindow.SetPart(0, 0, h - 1, w - 1);
op.DispObj(img, HWindowXCtrl1.HalconWindow.HalconID);
end;
end.

上一篇:Linux LAMP论坛搭建


下一篇:Java [Leetcode 303]Range Sum Query - Immutable