How to dynamic create ID2D1Geometry array ?


  • 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.

    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];

    but this method can not using.

    ID2D1Geometry GeoArray = new ID2D1Geometry[num]; // The "num" must have a const value, can not using my geometriescollection.size()

    In addition, if I initial a ID2D1Geometry array with " ID2D1Geometry GeoArray[1];".

    Is there any method can extend the array size such as using GeoArray.Append() ? Thanks.


    Thursday, May 23, 2013 6:27 AM

All replies

  • Hi,

    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.

    Best regards,

    Jesse Jiang
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, May 24, 2013 7:25 AM
  • Thanks for your reply.

    But can you give me some information about how to put the list information into a array in windows store apps. ( C++ )

    I had try to use vector to put the information to a Geometry array but fail.

    And the other method:


    ID2D1Geometry *xxx = new ID2D1Geometry[GeoList.size()];

            // Still can not initial the ID2D1Geometry *xxx, 

            // And I can not using "array  xxx "to save ID2D1Geometry, because I need to use this array to use on the FillGreometry with GeometryGroup


    • Edited by 風胤 Tuesday, May 28, 2013 3:04 AM
    Tuesday, May 28, 2013 2:08 AM