ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Keyframe Class
Members Example

In This Topic
    Keyframe Class
    In This Topic
    Represents the base class for all keyframe types.
    Syntax
    public abstract class Keyframe 
    Public MustInherit Class Keyframe 
    Remarks

    A keyframe is a visual way-point along the animation path in a map or scene. When an animation is played, values such as the location of the camera, the current map time, the current map range, and layer transparencies are interpolated between the stored states defined by the keyframe using a configurable transition type. The transition type defines how frames are interpolated between keyframes.

    For example, let's say we have 2 keyframes in a track one at a time of 0 seconds and the second at a time of 3 seconds. The first keyframe has a value for X of 1 and the second keyframe has a value for X of 5. The second keyframe defines the transition for X as linear. What this means is at 0 seconds in the animation X is 1, at 3 seconds X is 5 and at 1.5 seconds or halfway between the value would be 3. Each keyframe may have one or more values it stores and a corresponding transition definition for each value.

    Example
    Create Camera Keyframe
    public void CreateCameraKeyframe(TimeSpan atTime)
    {
      var mapView = MapView.Active;
      if (mapView != null)
        return;
    
      var animation = mapView.Map.Animation;
      var cameraTrack = animation.Tracks.OfType<CameraTrack>().First(); //There will always be only 1 CameraTrack in the animation.
      cameraTrack.CreateKeyframe(mapView.Camera, atTime, ArcGIS.Core.CIM.AnimationTransition.FixedArc);    
    }
    Inheritance Hierarchy
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also