大众信息网

ArcGis Engine C# 用户代码未处理COMException 指定的文件名无效

答案:3  mip版
解决时间 2021-04-04 08:57
  • 提问者网友:孤独食人心
  • 2021-04-03 23:19
private void axSymbolSelectorFrm_Load(object sender, EventArgs e)
{
//取得ArcGIS安装路径
string sInstall = ReadRegistry("SOFTWARE\\ESRI\\CoreRuntime");
//载入ESRI.ServerStyle文件到SymbologyControl
this.axSymbologyControl1.LoadStyleFile(sInstall + \\Styles\\ESRI.ServerStyle);——此句出错!!!!
//确定图层的类型(点线面),设置好SymbologyControl的StyleClass,设置好各控件的可见性(visible)
IGeoFeatureLayer pGeoFeatureLayer = (IGeoFeatureLayer)pLayer;
switch (((IFeatureLayer)pLayer).FeatureClass.ShapeType)
{
case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPoint:
this.SetFeatureClassStyle(esriSymbologyStyleClass.esriStyleClassMarkerSymbols);
this.lblAngle.Visible = true;
this.nudAngle.Visible = true;
this.lblSize.Visible = true;
this.nudSize.Visible = true;
this.lblWidth.Visible = false;
this.nudWidth.Visible = false;
this.lblOutlineColor.Visible = false;
this.btnOutlineColor.Visible = false;
break;
case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolyline:
this.SetFeatureClassStyle(esriSymbologyStyleClass.esriStyleClassLineSymbols);
this.lblAngle.Visible = false;
this.nudAngle.Visible = false;
this.lblSize.Visible = false;
this.nudSize.Visible = false;
this.lblWidth.Visible = true;
this.nudWidth.Visible = true;
this.lblOutlineColor.Visible = false;
this.btnOutlineColor.Visible = false;
break;
case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolygon:
this.SetFeatureClassStyle(esriSymbologyStyleClass.esriStyleClassFillSymbols);
this.lblAngle.Visible = false;
this.nudAngle.Visible = false;
this.lblSize.Visible = false;
this.nudSize.Visible = false;
this.lblWidth.Visible = true;
this.nudWidth.Visible = true;
this.lblOutlineColor.Visible = true;
this.btnOutlineColor.Visible = true;
break;
case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryMultiPatch:
this.SetFeatureClassStyle(esriSymbologyStyleClass.esriStyleClassFillSymbols);
this.lblAngle.Visible = false;
this.nudAngle.Visible = false;
this.lblSize.Visible = false;
this.nudSize.Visible = false;
this.lblWidth.Visible = true;
this.nudWidth.Visible = true;
this.lblOutlineColor.Visible = true;
this.btnOutlineColor.Visible = true;
break;
default:
this.Close();
break;
}
}
。。。
依然跪求大神指点迷津
最佳答案
  • 二级知识专家网友:对温柔懂得不多
  • 2021-04-03 23:54
将LicenseControl控件拖到窗体的任意位置就好了。
全部回答
  • 1楼网友:那年夏天
  • 2021-04-04 02:02
LoadStyleFile参数你使用绝对路径试试看! 再看看别人怎么说的。
  • 2楼网友:轉角離身
  • 2021-04-04 01:31
//Get the ArcGIS install location string sInstall = ESRI.ArcGIS.RuntimeManager.ActiveRuntime.Path; //Load the ESRI.ServerStyle file into the SymbologyControl axSymbologyControl1.LoadStyleFile(sInstall + "\\Styles\\ESRI.ServerStyle");
我要举报
如以上问答内容为低俗/色情/暴力/不良/侵权的信息,可以点下面链接进行举报,我们会做出相应处理,感谢你的支持!
点此我要举报以上问答信息
推荐资讯