Setting the animation environment
To set the animation environment, complete the following steps:
- Get a handle to the animation extension. The animation environment can be accessed through the animation extension object. The following code example shows how to get the animation extension in ArcGIS for Desktop applications (ArcMap, ArcGlobe, or ArcScene):
private IAnimationExtension GetAnimationExtension()
{
UID pUID=new UID();
pUID.Value="esriAnimation.AnimationExtension";
IAnimationExtension animExt;
animExt=(IAnimationExtension)m_application.FindExtensionByCLSID(pUID);
return animExt;
}
[VB.NET] Private Function GetAnimationExtension() As IAnimationExtension
Dim pUID As New UID
pUID.Value="esriAnimation.AnimationExtension"
Dim pAnimExt As IAnimationExtension
pAnimExt=m_application.FindExtensionByCLSID(pUID)
GetAnimationExtension=pAnimExt
End Function
- Get the animation environment from the animation extension. Typical animation environment variables include the animation duration, play mode, restore state after play option, number of frames in a time layer animation, and so on. The following code example shows how to get the animation environment and set some of the playing options:
private void Set_Animation_Environment()
{
//Get the animation extension.
IAnimationExtension animExt;
animExt=GetAnimationExtension();
//Get the animation environment from the animation extension.
IAGAnimationEnvironment animEnv;
animEnv=animExt.AnimationEnvironment;
//Set the duration of animation.
animEnv.AnimationDuration=8;
//Specify the time interval when the animation will be played.
animEnv.PutPlayInterval(3.5, 6.7);
//Set the interval play option to be true.
bool intervalPlay;
intervalPlay=animEnv.IsIntervalPlay;
if (intervalPlay == false)
{
animEnv.IsIntervalPlay=true;
}
//Set the play mode to be "play once forward."
animEnv.PlayMode=esriAnimationPlayMode.esriAnimationPlayOnceForward;
}
[VB.NET] Private Sub Set_Animation_Environment()
'Get the animation extension.
Dim animExt As IAnimationExtension
animExt=GetAnimationExtension()
'Get the animation environment from the animation extension.
Dim animEnv As IAGAnimationEnvironment
animEnv=animExt.AnimationEnvironment
'Set the duration of animation.
animEnv.AnimationDuration=8
'Specify the time interval when the animation will be played.
animEnv.PutPlayInterval(3.5, 6.7)
'Set the interval play option to be true.
Dim intervalPlay As Boolean
intervalPlay=animEnv.IsIntervalPlay
If intervalPlay=False Then
animEnv.IsIntervalPlay=True
End If
'Set the play mode to be "play once forward."
animEnv.PlayMode=esriAnimationPlayMode.esriAnimationPlayOnceForward
End Sub
Development licensing | Deployment licensing |
---|---|
ArcGIS for Desktop Basic | ArcGIS for Desktop Basic |
ArcGIS for Desktop Standard | ArcGIS for Desktop Standard |
ArcGIS for Desktop Advanced | ArcGIS for Desktop Advanced |