Currently I store X and Y using
Point[] points1 = new Point[] {
new Point { X = 262, Y = 321 },
new Point { X = 325, Y = 334 },
new Point { X = 278, Y = 387 }
};
how can I set variable 'points1' globally ? so I can using loop to pull the data X and Y.
Sample Code what I've tried
Point[] points1 = new Point[]{};
for(int i = 0 ; i <10 ;i ++)
{
points1 = new Point[] { new Point { X = i, Y = i++}};
}
but always get the last result instead of in array list.
itwice, once in the declaration of your loop and once atY = i++?