轻量高效的拓扑图组件
zh

Qunee Developer Guide

其他属性与方法

其他属性与方法

示例

将画布导出成图片,并在新的网页窗口中显示

function exportImage(graph, scale, clipBounds) {
    var imageInfo = graph.exportImage(scale, clipBounds);
    if (!imageInfo || !imageInfo.data) {
        return false;
    }
    var win = window.open();
    var doc = win.document;
    doc.title = "export image - " + imageInfo.width + " x " + imageInfo.height;
    var img = doc.createElement("img");
    img.src = imageInfo.data;
    doc.body.appendChild(img);
}