mapx使用经验(C#版)(未完成...)


一。可以动态生成Map
1 None.gif AxMapXLib.AxMap map  =   new  AxMapXLib.AxMap();
2 None.gifmap.Layers.RemoveAll();
3 None.gifmap.Parent  =   this ;
4 None.gifmap.Layers.Add(strFileName);


必须设置map.Parent = this;

否则不能显示。

二。很多组件使用标准动态链接库处理字体,颜色。
程序集为stdole.dll

stdole中使用BGR表示颜色。
而组件mapx,maplbjects很多地方使用RGB表示颜色
dotnet使用Argb表示颜色。

 1 None.gif using  stdole;
 2 None.gif uint  ArgbToBgr(System.Drawing.Color argb)
 3 ExpandedBlockStart.gifContractedBlock.gif dot.gif {
 4InBlock.gifuint r = argb.R;
 5InBlock.gifuint g = argb.G;
 6InBlock.gifuint b = argb.B;
 7InBlock.gifuint color = r|(g<<8)|(b<<16);
 8InBlock.gifreturn color;
 9ExpandedBlockEnd.gif}

10 None.gif
11 None.gif uint  RgbToBgr( uint  rgb)
12 ExpandedBlockStart.gifContractedBlock.gif dot.gif {
13InBlock.gifuint r = (rgb>>16)|0xFF;
14InBlock.gifuint g = (rgb>>8)|0xFF;
15InBlock.gifuint b = rgb|0xFF;
16InBlock.gifuint color = r|(g<<8)|(b<<16);
17InBlock.gifreturn color;
18ExpandedBlockEnd.gif}

19 None.gif uint  BgrToRgb( uint  bgr)
20 ExpandedBlockStart.gifContractedBlock.gif dot.gif {
21InBlock.gifreturn RgbToBgr(bgr);
22ExpandedBlockEnd.gif}

23 None.gif


还有在mapx和mapobjects 中都用stdole.IFont 表示字体。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值