in my app, a canvas moves when i move my handRigth (kinect SDK), I need to create a method (C#, Wpf)that allows me to store the coordinates of Y (arrayList of 100 positions). this method content:
alLastCoor_HandRight.Add(dYpuntero); //ArrayList, dYpuntero=Position
if (alLastCoor_HandRight.Count > 100)// Limit ArrayList 100 positions
alLastCoor_HandRight.RemoveAt(0);
and each time enter the method, store 100 positions of Y canvas position.
How can i do that ??
First of all, never use
ArrayListsas they do the same thing asListsonly less efficiently (see ArrayList vs List<object>). The way I would do this is by having aBooleanto decide if the count was greater than 100 or less than 100 like this:Then for your method, call it like this: