zoukankan      html  css  js  c++  java
  • 创建注记图层要素

    转自原文创建注记图层要素

    创建完文本注记TextElement后,可以选择以屏幕注记的形式加到屏幕上,也可以通过下面的方式转为注记图层要素:

     

                IFeatureClass annocls = 获取注记图层  
    IDataset pDataset = annocls as IDataset;  
    ITransactions pTransactions = pDataset.Workspace as ITransactions;  
    pTransactions.StartTransaction();  
    IFDOGraphicsLayerFactory pFDOGLFactory = new FDOGraphicsLayerFactoryClass();  
    ILayer tmpLayer = pFDOGLFactory.OpenGraphicsLayer(pDataset.Workspace as IFeatureWorkspace, annocls.FeatureDataset, pDataset.Name);  
    IFDOGraphicsLayer pFDOGLayer = tmpLayer as IFDOGraphicsLayer;  
    IElementCollection pElementColl = new ElementCollectionClass();  
    pFDOGLayer.BeginAddElements();  
    ////每新增100个提交下,最后再提交下。防止过多转换失败  
    if ((pElementColl != null) && (pElementColl.Count == 100))  
    {  
        pFDOGLayer.DoAddElements(pElementColl, 0);  
        pFDOGLayer.EndAddElements();  
        pElementColl.Clear();  
        pTransactions.CommitTransaction();  
        pTransactions.StartTransaction();  
        pFDOGLayer.BeginAddElements();  
    }  
    if (pElementColl.Count > 0)  
    pFDOGLayer.DoAddElements(pElementColl, 0);  
    pFDOGLayer.EndAddElements();  
    pElementColl.Clear();  
    pTransactions.CommitTransaction();  

     

     

  • 相关阅读:
    TcpClient
    文字识别
    halcon17.12 win7 64深度学框架搭建
    halcon多个形状模板匹配
    halcon 瓶盖定位
    halcol9点标定
    一个机械臂的正逆解
    Matlab robot-9.10(rvctools) 建模与正逆解
    16路舵机控制器USB访问
    C#二维码识别
  • 原文地址:https://www.cnblogs.com/arxive/p/6262836.html
Copyright © 2011-2022 走看看