跳转到主要内容
必须套索之后才能调用该接口,否则会调用失败。 并且必须套索笔划或几何图形数据,其他数据无法转化为贴纸。
static saveStickerByLasso(path: string): Promise<APIResponse<boolean>>;
参数
参数类型说明
pathstring贴纸保存路径
返回

示例

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

/**
 * 将当前套索中的笔划或几何图形保存为贴纸的示例。
 */
export async function exampleSaveStickerByLasso() {
  const outPath = '/storage/emulated/0/Note/stickers/lasso.sticker';
  const res = await PluginCommAPI.saveStickerByLasso(outPath);
  if (!res.success) {
    throw new Error(res.error?.message ?? 'saveStickerByLasso 调用失败');
  }
  return res.result;
}