This sample illustrates how to export an animation to a QuickTime video. The QuickTime player must be installed on your computer, which can be downloaded from www.apple.com/quicktime.
How to use
- Open an ArcMap document;
- Create one or more animation tracks in ArcMap using the animation toolbar (any type of animation is good);
- Copy and paste the following code into the VB editor in ArcMap, and change the export path to your own path;
- Make sure that "ESRI Animation Object Library" and "ESRI AnimationUI Object Library" are checked in the References dialog box of the VBA project;
- Run the macro "Export_Animation_QT";
- Verify that a QuickTime video file is created by playing it in the QuickTime player.
Public Sub Export_Animation_QT()
'Find the animation extension
Dim pUID As New UID
pUID.Value = "esriAnimation.AnimationExtension"
Dim pAnimExt As IAnimationExtension
Set pAnimExt = Application.FindExtensionByCLSID(pUID)
'Create an instance of videoexporter
Dim pVideoExporter As IVideoExporter
Set pVideoExporter = New AnimationExporterQT
'Get statusbar from application
Dim pStatusBar As IStatusBar
Set pStatusBar = Application.StatusBar
'Set animation exporter properties
pVideoExporter.ExportFileName = "C:\Temp\VideoExp.mov"
pVideoExporter.ShowSettingsDialog = False
pVideoExporter.Codec = "8BPS:Planar RGB"
pVideoExporter.FrameRate = 30
pAnimExt.AnimationEnvironment.AnimationDuration = 5
'Export animation
pVideoExporter.ExportAnimation pAnimExt.AnimationTracks, pAnimExt.AnimationEnvironment, pStatusBar
End Sub