zoukankan      html  css  js  c++  java
  • 初探GIS Mapxtreme 添加自定义图元 bmp

    添加自定义 图元,将bmp 放入 C:\Program Files\Common Files\MapInfo\MapXtreme\6.8.0\CustSymb目录下

    这个 6.8.0 是版本号。

    /// <summary>
    /// 添加自定义图元
    /// </summary>
    /// <param name="dPoint">点坐标</param>
    public void AddCustomFeature(DPoint dPoint)
    {
    TableInfoMemTable tableInfoMemTable
    = new TableInfoMemTable("temp");
    tableInfoMemTable.Columns.Add(ColumnFactory.CreateFeatureGeometryColumn(map.GetDisplayCoordSys()));
    tableInfoMemTable.Columns.Add(ColumnFactory.CreateStyleColumn());
    //样式列
    Table table = MapInfo.Engine.Session.Current.Catalog.CreateTable(tableInfoMemTable);
    FeatureLayer featureLayer
    = new FeatureLayer(table);
    map.Layers.Add(featureLayer);

    FeatureGeometry featureGeometry
    = new MapInfo.Geometry.Point(featureLayer.CoordSys, dPoint);
    BitmapPointStyle bitmapPointStyle
    = new BitmapPointStyle("chinaz2.BMP", BitmapStyles.None, new System.Drawing.Color(), 25);
    CompositeStyle compositeStyle
    = new CompositeStyle(bitmapPointStyle);

    Feature feature
    = new Feature(featureLayer.Table.TableInfo.Columns);
    feature.Geometry
    = featureGeometry;
    feature.Style
    = compositeStyle;

    featureLayer.Table.InsertFeature(feature);
    }
  • 相关阅读:
    BI之SSAS完整实战教程1 -- 开篇, BI简介 & SSAS简介
    MVC 5 + EF6 入门完整教程14 -- 动态生成面包屑导航
    MVC5+EF6 入门完整教程12--灵活控制Action权限
    JVM垃圾收集
    JVM类加载
    前端UI框架
    前端学习
    JVM字节码
    网络编程
    Java NIO
  • 原文地址:https://www.cnblogs.com/liuyunsheng/p/1965640.html
Copyright © 2011-2022 走看看