阅读:1388回复:1
[求助]mo+c#添加图层出现的问题<P>using MapObjects2;<BR>using System.IO;<BR>using System.Drawing.Drawing2D;</P> <P>uing System;</P> <P>private void Form1_Load(object sender, System.EventArgs e)<BR> {<BR> <BR> try<BR> {<BR> MapObjects2.DataConnection dc=new MapObjects2.DataConnectionClass();<BR> this.layer =new MapObjects2.MapLayerClass ();<BR> dc.Database=Path.GetFullPath(@"data\shape");<BR> <BR> // dc.Database=Path.GetFullPath(@"<a>\\192.168.0.06\public\zxjc\data\shape</A>");<BR> // Console.WriteLine(Path.GetFullPath("trails"));<BR> if (!dc.Connect())<BR> {<BR> MessageBox.Show("在指定的文件夹下没有找到图层数据文件!","环境污染源监控监测控软件" ,MessageBoxButtons.OK,MessageBoxIcon.Information );<BR> Application.Exit();<BR> }<BR> else<BR> {<BR> //区域<BR> layer=new MapObjects2.MapLayerClass();<BR> layer.GeoDataset=dc.FindGeoDataset("distr");<BR> layer.Name ="区域";<BR> layer.Symbol.Color=moRed;<BR> //c=axMap1.RG.RGBToMo("250,195,255");<BR> layer.Visible=true;<BR> axMap1.Layers.Add(layer);<BR> axMap1.Refresh();</P> <P>catch(Exception ex)<BR> {<BR> MessageBox.Show(ex.Message+"加载图层错误!","环境污染源监控监测控软件",MessageBoxButtons.OK,MessageBoxIcon.Information );<BR> }</P> <P>}</P> <P>问题出现在定义颜色的地方(mored,或rgbtomo)中,麻烦高手看看!</P> |
|
1楼#
发布于:2006-08-22 10:04
moRed这个地方改成(uint)ColorConstants.moRed
|
|