if (MainSceneControl.Scene.LayerCount == 0)
{
MessageBox.Show("请加载场景");
}
else
{
try
{
SaveFileDialog imageexportDialog = new SaveFileDialog();
imageexportDialog.Title = "保存三维图片";
imageexportDialog.DefaultExt = "jpg";
imageexportDialog.Filter = "JPG格式(*.jpg)|*.jpg|BMP格式(*.bmp)|*.bmp";
imageexportDialog.FilterIndex = 1;
imageexportDialog.OverwritePrompt = true;
imageexportDialog.Title = "";
imageexportDialog.ShowDialog();
//SceneHookHelper m_SceneHookHelper=new SceneHookHelper();
if (imageexportDialog.FileName != "")
{
if (imageexportDialog.FilterIndex == 1)
{
MainSceneControl.SceneViewer.GetScreenShot(esri3DOutputImageType.JPEG, imageexportDialog.FileName);
}
else
{
MainSceneControl.SceneViewer.GetScreenShot(esri3DOutputImageType.BMP, imageexportDialog.FileName);
}
//MainSceneControl.Show("图片导出成功" + imageexportDialog.FileName, "", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
else
{
MessageBox.Show("请输入图片名称");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
导出三维场景的图片
最新推荐文章于 2022-11-22 13:52:53 发布