zw版【转发·台湾nvp系列Delphi例程】HALCON SetMshape
procedure TForm1.FormShow(Sender: TObject);
var
img : HImageX;
w, h : OleVariant;
ShapeNames : OleVariant;
ht : HTupleX;
i, n : Longint;
begin
ht := CoHTupleX.Create;
img := CoHImageX.Create;
img.ReadImage(‘monkey‘);
w := img.GetImageSize(h);
HWindowXCtrl1.HalconWindow.SetPart(0, 0, h - 1, w - 1);
img.DispObj(HWindowXCtrl1.HalconWindow);
ShapeNames := HWindowXCtrl1.HalconWindow.QueryMshape;
n := Longint(ht.TupleLength(ShapeNames)) - 1;
for i := 0 to n do
ListBox1.Items.Add(ht.TupleSelect(ShapeNames, i));
end;
procedure TForm1.ListBox1Click(Sender: TObject);
begin
if ListBox1.ItemIndex <> -1 then
HWindowXCtrl1.HalconWindow.SetMshape(ListBox1.Items[ListBox1.ItemIndex]);
end;
zw版【转发·台湾nvp系列Delphi例程】HALCON SetMshape
原文:http://www.cnblogs.com/ziwang/p/4851012.html