在使用UnionAggregate时,如果想要保留起始点,可以使用以下代码示例:
// 创建UnionAggregate对象
var unionAggregate = new UnionAggregate();
// 添加起始点
unionAggregate.Points.Add(new Point(1, 2));
// 添加其他点
unionAggregate.Points.Add(new Point(3, 4));
unionAggregate.Points.Add(new Point(5, 6));
// 获取UnionAggregate中的起始点
var startingPoint = unionAggregate.Points[0];
// 输出起始点
Console.WriteLine($"Starting point: X={startingPoint.X}, Y={startingPoint.Y}");
上述示例中,我们首先创建了一个UnionAggregate对象。然后,我们通过使用Points.Add
方法来添加起始点和其他点。最后,我们可以通过访问Points
属性中的第一个元素来获取UnionAggregate中的起始点。
请注意,这只是一个示例,具体的实现方式可能会根据你使用的编程语言和具体的类库有所不同。请根据你的实际需求和文档来使用相应的方法来获取UnionAggregate中的起始点。