必须套索之后才能调用该接口,否则会调用失败。
并且必须套索笔划或几何图形数据,其他数据无法转化为贴纸。
返回
APIResponse<boolean>:result === true表示保存成功
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
保存套索中的笔划为贴纸。
static saveStickerByLasso(path: string): Promise<APIResponse<boolean>>;
| 参数 | 类型 | 说明 |
|---|---|---|
path | string | 贴纸保存路径 |
APIResponse<boolean>:result === true 表示保存成功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;
}