private void Form1_Load(object sender, System.EventArgs e) { //check and load if the animation file is present... m_AnimFilePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); m_AnimFilePath = Path.Combine(m_AnimFilePath, @"ArcGIS\data\Globe\AnimationSample.aga"); var filePath = new DirectoryInfo(m_AnimFilePath); System.Diagnostics.Debug.WriteLine(string.Format("File path for data root: {0} [{1}]", filePath.FullName, Directory.GetCurrentDirectory())); if (!File.Exists(m_AnimFilePath)) { throw new Exception(string.Format("Fix code to point to your sample data: {0} [{1}] was not found", filePath.FullName, Directory.GetCurrentDirectory())); } if (System.IO.File.Exists(m_AnimFilePath)) { //Load the sample animation file into the animation file into the doc... IGlobe globe = axGlobeControl1.Globe; IBasicScene basicScene = (IBasicScene)globe; basicScene.LoadAnimation(m_AnimFilePath); } else { //Disable Animation Player controls... OptDuration.Enabled = false; OptIteration.Enabled = false; txtDuration.Enabled = false; TxtFrequency.Enabled = false; TxtFrequency.Enabled = false; CmdPlay.Enabled = false; } Icon = null; }
private void CmdLoad_Click(object sender, System.EventArgs e) { openFileDialog1.Title = "Open ArcGlobe Animation File"; openFileDialog1.Filter = "ArcGlobe Animation Files (*.aga)|*.aga"; //set ArcGlobeAnimaton path folder as default path... if (m_AnimFilePath != "") { openFileDialog1.InitialDirectory = m_AnimFilePath; } else { openFileDialog1.InitialDirectory = Application.StartupPath; } openFileDialog1.ShowDialog(); //if the user selected an animation file string animFilePath = openFileDialog1.FileName; if (animFilePath == "") { return; } //sAnimFilePath IGlobe globe = axGlobeControl1.Globe; IBasicScene basicScene = (IBasicScene)globe; basicScene.LoadAnimation(animFilePath); //if loading of the animation succeeded, enable player controls... //Enable Animation Player controls... OptDuration.Enabled = true; OptIteration.Enabled = true; txtDuration.Enabled = true; TxtFrequency.Enabled = true; TxtFrequency.Enabled = true; CmdPlay.Enabled = true; }
private void Form1_Load(object sender, System.EventArgs e) { //check and load if the animation file is present... m_AnimFilePath = @"..\..\..\..\..\Data\ArcGlobeAnimation\AnimationSample.aga"; if (System.IO.File.Exists(m_AnimFilePath)) { //Load the sample animation file into the animation file into the doc... IGlobe globe = axGlobeControl1.Globe; IBasicScene basicScene = (IBasicScene)globe; basicScene.LoadAnimation(m_AnimFilePath); } else { //Disable Animation Player controls... OptDuration.Enabled = false; OptIteration.Enabled = false; txtDuration.Enabled = false; TxtFrequency.Enabled = false; TxtFrequency.Enabled = false; CmdPlay.Enabled = false; } Icon = null; }