跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.supernote.com/llms.txt

Use this file to discover all available pages before exploring further.

static generateLassoPreview(imagePath: string): Promise<APIResponse<LassoPreview>>;
参数
参数类型说明
imagePathstring预览图片输出路径
返回
  • APIResponse<T>result 为套索预览数据对象,结构如下:
字段类型说明
imagePathstring生成的预览图片路径
rectRect套索区域
rotateDegreenumber旋转角度

示例

import { PluginCommAPI } from 'sn-plugin-lib';

/**
 * 生成套索元素预览图的示例。
 */
export async function exampleGenerateLassoPreview() {
  const res = await PluginCommAPI.generateLassoPreview('/storage/emulated/0/Note/out/lasso-preview.png');
  if (!res.success) {
    throw new Error(res.error?.message ?? 'generateLassoPreview 调用失败');
  }
  return res.result;
}