2D图纸怎么调用Annotation的接口,实现画批注的效果?

2D图纸怎么调用Annotation的接口,实现画批注的效果?
是否可以createSnapshot,把批注截图下来。

阅读 1.2k
评论
    1 个回答

    //创建批注
    function createAnnotation(viewer){

    var config = new Glodon.Bimface.Plugins.Annotation.AnnotationToolbarConfig();
    config.viewer = viewer;//2D图纸
    annotationToolbar = new Glodon.Bimface.Plugins.Annotation.AnnotationToolbar(config);
    AnnotationToolbarEvent = Glodon.Bimface.Plugins.Annotation.AnnotationToolbarEvent
    annotationToolbar.addEventListener(AnnotationToolbarEvent.Saved,function(list){
      list = list;
    });
    annotation = annotationToolbar.getAnnotationManager();
    annotationToolbar.show()
    

    }

    //导出截屏

    var prop = document.getElementById("prop");
    var content = document.getElementById("content");
    var close = document.getElementById("close");
    document.getElementById("createSnapshot").addEventListener("click",function(){

    annotation.createSnapshot(function(image){
      var img = new Image();
      img.src = image;
      prop.style.display = "block";
      content.innerHTML = "";
      content.appendChild(img);
    })

    });

    clipboard.png

      撰写回答

      登录后参与交流、获取后续更新提醒