套索元素之后才能调用这个接口,否则会调用失败。
APIResponse<Rect>:result为Rect,使用的是像素点坐标。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
获取套索框区域位置。
static getLassoRect(): Promise<APIResponse<Rect>>;
APIResponse<Rect>:
result 为 Rect,使用的是像素点坐标。import { PluginCommAPI, type Rect } from 'sn-plugin-lib';
/**
* 获取套索框矩形的示例。
*/
export async function exampleGetLassoRect(): Promise<Rect> {
const res = await PluginCommAPI.getLassoRect();
if (!res.success) {
throw new Error(res.error?.message ?? 'getLassoRect 调用失败');
}
return res.result;
}