如何动态创建ID2D1Geometry数组? [英] How to dynamic create ID2D1Geometry array ?
问题描述
我需要绘制一个GeometryGroup,我知道如何将geometry []设置为CreategeometryGroup函数。但是当我需要将大量几何加载到几何数组时。
I need to draw a GeometryGroup, and I know how to set the geometry[] to the CreategeometryGroup function. But when I need to load a lot of geometries to a geometry array.
我不知道如何使用"for function"设置数组值。在我搜索一些初始动态数组方法之后初始几何数组,例如:
I do not know how to set the array value with "for function" and initial the geometry array, after I search some initial dynamic array method such as :
int a = new int [num];
int a = new int[num];
但是这个方法不能使用。
but this method can not using.
ID2D1Geometry GeoArray = new ID2D1Geometry [num]; //"num"必须有一个const值,不能使用我的geometrytriescollection.size()
ID2D1Geometry GeoArray = new ID2D1Geometry[num]; // The "num" must have a const value, can not using my geometriescollection.size()
另外,如果我用"<"初始化ID2D1Geometry数组ID2D1Geometry GeoArray [1];"。
In addition, if I initial a ID2D1Geometry array with " ID2D1Geometry GeoArray[1];".
是否有任何方法可以扩展数组大小,例如使用GeoArray.Append()?谢谢。
Is there any method can extend the array size such as using GeoArray.Append() ? Thanks.
风胤
推荐答案
也许你可以创建一个包含ID2D1Geometry的列表,当你使用它时,你可以把它们放基于列表大小的数组。
Maybe you can create a list to contain ID2D1Geometry, when you use it, you can put them into a array based on the size of list.
最好的问候,
Jesse
Best regards,
Jesse
这篇关于如何动态创建ID2D1Geometry数组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!