A
A
Aidar922015-10-17 11:52:40
C++ / C#
Aidar92, 2015-10-17 11:52:40

How to convert dot array to numeric in c#?

I have an array of points in System.Drawing.Point[] format and I need to get a two-dimensional array of x, y and z=0 coordinates in float[,] format from it. How can I do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Makarov, 2015-10-17
@Aidar92

System.Drawing.Point[] points = ...
float[,] data = new float[points.Length, 3];
for (int i = 0; i < points.Length; i++)
{
  data[i, 0] = points[i].X;
  data[i, 1] = points[i].Y;
  data[i, 2] = 0.0f;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question