0

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

2017-12-14 提问
1 个回答
0

已采纳

//创建批注
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

撰写答案

推广链接