前言
C# 联合halcon实现绘制箭头。
代码
HObject ho_Arrow = new HObject();
HTuple hv_Row = new HTuple();
HTuple hv_Column = new HTuple();
try
{
HOperatorSet.SetColor(window, "blue");
HOperatorSet.DrawPoint(window, out hv_Row, out hv_Column);
HOperatorSet.SetColor(window, (new HTuple("red")).TupleConcat("green"));
GenArrow.Gen_arrow_contour_xld(out ho_Arrow,
hv_Row.TupleConcat(hv_Row), hv_Column.TupleConcat(hv_Column),
((hv_Row + 200)).TupleConcat(hv_Row),
hv_Column.TupleConcat(hv_Column + 200), 5, 5);
HOperatorSet.DispObj(ho_Arrow, window);
}
catch (Exception ex)
{
Debug.Write(ex.ToString());
}
finally
{
ho_Arrow.Dispose();
hv_Row.Dispose();
hv_Column.Dispose();
}