ArcGis Engine C# 用户代码未处理COMException 指定的文件名无效
privatevoidaxSymbolSelectorFrm_Load(objectsender,EventArgse){//取得ArcGIS安装路径stringsIns...
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;
}
}
。。。
依然跪求大神指点迷津 展开
{
//取得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;
}
}
。。。
依然跪求大神指点迷津 展开
3个回答
展开全部
//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");
string sInstall = ESRI.ArcGIS.RuntimeManager.ActiveRuntime.Path;
//Load the ESRI.ServerStyle file into the SymbologyControl
axSymbologyControl1.LoadStyleFile(sInstall + "\\Styles\\ESRI.ServerStyle");
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
将LicenseControl控件拖到窗体的任意位置就好了。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
LoadStyleFile参数你使用绝对路径试试看!
追问
谢谢,换了绝对路径就好了,但下句话又报错了
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询