This document is archived and information here might be outdated.  Recommended version.


Create Animation QuickTime Snippet (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference

Create Animation QuickTime Snippet

Exports the current animation in globe to a QuickTime movie file. Note - In order to export animation to QuickTime movie, QuickTime player should be installed on the machine.

[C#]
///<summary>Exports the current animation in globe to a QuickTime movie file. Note - In order to export animation to QuickTime movie, QuickTime player should be installed on the machine.</summary>
/// 
///<param name="globe">An IGlobe interface</param>
///<param name="exportFileName">A System.String that is the path and filename of the Quick Time file to be exported. Example: ex: "C:\temp\myanimation.qt"</param>
///<param name="duration">A System.Double that is the length (or duration) in seconds of the Quick Time movie. Example: 30</param>
///  
///<remarks></remarks>
public void CreateAnimationQuickTime(ESRI.ArcGIS.GlobeCore.IGlobe globe, System.String exportFileName, System.Double duration)
{
  //Find the animation extension
  ESRI.ArcGIS.Analyst3D.IBasicScene2 basicScene2=(ESRI.ArcGIS.Analyst3D.IBasicScene2)globe; // Explicit Cast

  ESRI.ArcGIS.Animation.IAnimationExtension animationExtension=basicScene2.AnimationExtension;
  ESRI.ArcGIS.Animation.IAGAnimationEnvironment AGAnimationEnvironment=basicScene2.AnimationExtension.AnimationEnvironment;

  // Create an instance of videoexporter
  ESRI.ArcGIS.Animation.IVideoExporter videoExporter=new ESRI.ArcGIS.Animation.AnimationExporterQTClass();

  videoExporter.ExportFileName=exportFileName;
  videoExporter.ShowSettingsDialog=false;

  videoExporter.Codec="8BPS:Planar RGB";
  videoExporter.FrameRate=30;
  animationExtension.AnimationEnvironment.AnimationDuration=duration;

  videoExporter.ExportAnimation(animationExtension.AnimationTracks, animationExtension.AnimationEnvironment, null);
}
[Visual Basic .NET]
'''<summary>Exports the current animation in globe to a QuickTime movie file. Note - In order to export animation to QuickTime movie, QuickTime player should be installed on the machine.</summary>
''' 
'''<param name="globe">An IGlobe interface</param>
'''<param name="exportFileName">A System.String that is the path and filename of the Quick Time file to be exported. Example: ex: "C:\temp\myanimation.qt"</param>
'''<param name="duration">A System.Double that is the length (or duration) in seconds of the Quick Time movie. Example: 30</param>
'''  
'''<remarks></remarks>
Public Sub CreateAnimationQuickTime(ByVal globe As ESRI.ArcGIS.GlobeCore.IGlobe, ByVal exportFileName As System.String, ByVal duration As System.Double)

  ' Find the animation extension
  Dim basicScene2 As ESRI.ArcGIS.Analyst3D.IBasicScene2=CType(globe, ESRI.ArcGIS.Analyst3D.IBasicScene2) ' Explicit Cast

  Dim animationExtension As ESRI.ArcGIS.Animation.IAnimationExtension=basicScene2.AnimationExtension
  Dim AGAnimationEnvironment As ESRI.ArcGIS.Animation.IAGAnimationEnvironment=basicScene2.AnimationExtension.AnimationEnvironment

  ' Create an instance of videoexporter
  Dim videoExporter As ESRI.ArcGIS.Animation.IVideoExporter=New ESRI.ArcGIS.Animation.AnimationExporterQTClass

  videoExporter.ExportFileName=exportFileName
  videoExporter.ShowSettingsDialog=False

  videoExporter.Codec="8BPS:Planar RGB"
  videoExporter.FrameRate=30
  animationExtension.AnimationEnvironment.AnimationDuration=duration

  videoExporter.ExportAnimation(animationExtension.AnimationTracks, animationExtension.AnimationEnvironment, Nothing)

End Sub

Additional Requirements
  • The code in this document requires the following References added to the Visual Studio project:
  • ESRI.ArcGIS.3DAnalyst
  • ESRI.ArcGIS.Animation
  • ESRI.ArcGIS.GlobeCore
  • ESRI.ArcGIS.System