private void button2_Click(object sender, EventArgs e) { ssFile = Path.Combine(Application.StartupPath, System.DateTime.Now.ToString("GES_yyyyMMddHHmmss") + ".jpg"); try { //quality的取值范围在(0,100)之间,质量越高,quality越大 GEApp.SaveScreenShot(ssFile, 100); //载入刚才的图像 pictureBox1.Image = Bitmap.FromFile(ssFile); } catch (Exception ex) { MessageBox.Show("保存截屏图像时发生错误:" + ex.ToString()); } }
private void btnGESnap_Click(object sender, EventArgs e) { if (CheckGEState(true, "GESnap")) { using (SaveFileDialog sfd = new SaveFileDialog()) { sfd.Filter = "JPEG图片(*.jpg)|*.jpg"; sfd.AddExtension = true; sfd.CheckPathExists = true; sfd.Title = "保存Google Earth截图"; if (sfd.ShowDialog() == DialogResult.OK) { GEApp.SaveScreenShot(sfd.FileName, 100); msgToolTip.Show("\'" + sfd.FileName + "\' Saved", tabGEViewer, tabGEViewer.Width / 4, tabGEViewer.Height / 4, 2000); } } } }
private void button1_Click(object sender, EventArgs e) { if (GEApp != null && GEApp.IsInitialized() > 0) { using (SaveFileDialog sfd = new SaveFileDialog()) { sfd.Filter = "JPEG图片(*.jpg)|*.jpg"; sfd.AddExtension = true; sfd.CheckPathExists = true; sfd.Title = "保存Google Earth截图"; if (sfd.ShowDialog() == DialogResult.OK) { GEApp.SaveScreenShot(sfd.FileName, 100); toolTip1.Show("\'" + sfd.FileName + "\' Saved", tabPage1, 300, 200, 2000); } } } }