【问题标题】:OneNote InkStroke/FloatingInk APIOneNote InkStroke/FloatingInk API
【发布时间】:2017-07-20 00:37:42
【问题描述】:

OneNote 中有一个用于获取墨迹对象的 API。根据示例/documentation,您可以运行获取 InkStroke 对象的代码。我的理解是,Highlighter 笔画是 OneNote 对象模型中的 FloatingInk。是否可以获得有关中风本身的信息?比如:

if(inkObject.getType() == "Highlighter") {
    var width = inkObject.getStroke().width;
    var height = inkObject.getStroke().height;
}

文档在下面显示了一个示例,但它似乎只使“id”属性可用。

OneNote.run(function(context) {

    // Gets the active page.
    var page = context.application.getActivePage();
    var contents = page.contents;

    // Load page contents and their types.
    page.load('contents/type');
    return context.sync()
        .then(function(){

            // Load every ink content.
            $.each(contents.items, function(i, content) {
                if (content.type == "Ink"){
                    content.load('ink/id');
                }                           
            })
            return context.sync();
        })
        .then(function(){

            // Log ID of every ink content.
            $.each(contents.items, function(i, content) {
                if (content.type == "Ink"){
                    console.log(content.ink.id);
                }                           
            })              
        });
})
.catch(function(error) {
    console.log("Error: " + error);
    if (error instanceof OfficeExtension.Error) {
        console.log("Debug info: " + JSON.stringify(error.debugInfo));
    }
}); 

【问题讨论】:

    标签: office-addins onenote onenote-api


    【解决方案1】:

    编辑:虽然不理想,但您可以获取 RestApiId,然后进行 API 调用以检索包含此信息的 InkML 文档。

    https://blogs.msdn.microsoft.com/onenotedev/2017/07/07/onenote-ink-beta-apis/


    很遗憾,无法从 OneNote 加载项中获取墨迹笔划坐标信息。我鼓励您提交用户语音项目并将其链接到此处。

    https://onenote.uservoice.com/forums/245490-onenote-developer-apis/

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多