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>>;
参数
| 参数 | 类型 | 说明 |
|---|
imagePath | string | 预览图片输出路径 |
返回
| 字段 | 类型 | 说明 |
|---|
imagePath | string | 生成的预览图片路径 |
rect | Rect | 套索区域 |
rotateDegree | number | 旋转角度 |
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;
}