public void SetKeyFrameMap(SortedDictionary <long, long> map) { var mappingData = new List <IntPtr>(); foreach (var mapping in map) { mappingData.Add(new IntPtr(mapping.Key)); mappingData.Add(new IntPtr(mapping.Value)); } RubberBandNativeMethods.RubberBandStretcher_SetKeyFrameMap(_rbs, mappingData.ToArray(), mappingData.Count / 2); }