Copying values from List to Jagged array
-
ref PointF[][] P;
List<PointF> tP
How to assign TP values to jagged array P? I tried P[0] = TP. but iam getting the following error. error CS0029: Cannot implicitly convert type 'System.Collections.Generic.List<System.Drawing.PointF>' to 'System.Drawing.PointF[]' Please solve this problem.
-
ref PointF[][] P;
List<PointF> tP
How to assign TP values to jagged array P? I tried P[0] = TP. but iam getting the following error. error CS0029: Cannot implicitly convert type 'System.Collections.Generic.List<System.Drawing.PointF>' to 'System.Drawing.PointF[]' Please solve this problem.
If your list holds intems of type PointF then how do you expect it to create a jagged array of PointFs from it. You can create an array by
PointF[] pointFArray;
pointFArray = tP.ToArray();If you want a jagged array - the only sensible thing would be
float[][] pointFJaggedArray;
If you do this, you'll need to set thepointFJaggedArray
length to the same as the List and then iterate through the list and assign each x and y float value to each item in the array.Dave