一。可以动态生成Map
1
AxMapXLib.AxMap map
=
new
AxMapXLib.AxMap();
2 map.Layers.RemoveAll();
3 map.Parent = this ;
4 map.Layers.Add(strFileName);
2 map.Layers.RemoveAll();
3 map.Parent = this ;
4 map.Layers.Add(strFileName);
必须设置map.Parent = this;
否则不能显示。
二。很多组件使用标准动态链接库处理字体,颜色。
程序集为stdole.dll
stdole中使用BGR表示颜色。
而组件mapx,maplbjects很多地方使用RGB表示颜色
dotnet使用Argb表示颜色。
1
using
stdole;
2 uint ArgbToBgr(System.Drawing.Color argb)
3 {
4uint r = argb.R;
5uint g = argb.G;
6uint b = argb.B;
7uint color = r|(g<<8)|(b<<16);
8return color;
9}
10
11 uint RgbToBgr( uint rgb)
12 {
13uint r = (rgb>>16)|0xFF;
14uint g = (rgb>>8)|0xFF;
15uint b = rgb|0xFF;
16uint color = r|(g<<8)|(b<<16);
17return color;
18}
19 uint BgrToRgb( uint bgr)
20 {
21return RgbToBgr(bgr);
22}
23
2 uint ArgbToBgr(System.Drawing.Color argb)
3 {
4uint r = argb.R;
5uint g = argb.G;
6uint b = argb.B;
7uint color = r|(g<<8)|(b<<16);
8return color;
9}
10
11 uint RgbToBgr( uint rgb)
12 {
13uint r = (rgb>>16)|0xFF;
14uint g = (rgb>>8)|0xFF;
15uint b = rgb|0xFF;
16uint color = r|(g<<8)|(b<<16);
17return color;
18}
19 uint BgrToRgb( uint bgr)
20 {
21return RgbToBgr(bgr);
22}
23
还有在mapx和mapobjects 中都用stdole.IFont 表示字体。