PCB & 封装 / 二进制内嵌对象图元类
declare class PCB_PrimitiveObject implements IPCB_PrimitiveAPI Implements: IPCB_PrimitiveAPI
彩色丝印图像属于二进制内嵌对象,需要使用二进制内嵌对象的方法创建和修改
|
Method |
Modifiers |
Description |
|---|---|---|
|
(BETA) 创建二进制内嵌对象 | ||
|
(BETA) 删除二进制内嵌对象 | ||
|
(BETA) 获取二进制内嵌对象 | ||
|
(BETA) 获取二进制内嵌对象 | ||
|
(BETA) 获取所有二进制内嵌对象 | ||
|
(BETA) 获取所有二进制内嵌对象的图元 ID | ||
|
(BETA) 修改二进制内嵌对象 |
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
创建二进制内嵌对象
create(layer: TPCB_LayersOfObject, topLeftX: number, topLeftY: number, binaryData: string, width: number, height: number, rotation?: number, mirror?: boolean, fileName?: string, primitiveLock?: boolean): Promise<IPCB_PrimitiveObject | undefined>;|
Parameter |
Type |
Description |
|---|---|---|
|
layer |
层 | |
|
topLeftX |
number |
左上点 X |
|
topLeftY |
number |
左上点 Y |
|
binaryData |
string |
二进制数据 |
|
width |
number |
宽 |
|
height |
number |
高 |
|
rotation |
number |
(Optional) 旋转角度 |
|
mirror |
boolean |
(Optional) 是否水平镜像 |
|
fileName |
string |
(Optional) 文件名 |
|
primitiveLock |
boolean |
(Optional) 是否锁定 |
Promise<IPCB_PrimitiveObject | undefined>
- 二进制内嵌对象图元对象
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
删除二进制内嵌对象
delete(primitiveIds: string | IPCB_PrimitiveObject | Array<string> | Array<IPCB_PrimitiveObject>): Promise<boolean>;|
Parameter |
Type |
Description |
|---|---|---|
|
primitiveIds |
string | IPCB_PrimitiveObject | Array<string> | Array<IPCB_PrimitiveObject> |
二进制内嵌对象的图元 ID 或二进制内嵌对象图元对象 |
Promise<boolean>
删除操作是否成功
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
获取二进制内嵌对象
get(primitiveIds: string): Promise<IPCB_PrimitiveObject | undefined>;|
Parameter |
Type |
Description |
|---|---|---|
|
primitiveIds |
string |
二进制内嵌对象的图元 ID,可以为字符串或字符串数组,如若为数组,则返回的也是数组 |
Promise<IPCB_PrimitiveObject | undefined>
二进制内嵌对象图元对象,undefined 表示获取失败
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
获取二进制内嵌对象
get(primitiveIds: Array<string>): Promise<Array<IPCB_PrimitiveObject>>;|
Parameter |
Type |
Description |
|---|---|---|
|
primitiveIds |
Array<string> |
二进制内嵌对象的图元 ID,可以为字符串或字符串数组,如若为数组,则返回的也是数组 |
Promise<Array<IPCB_PrimitiveObject>>
二进制内嵌对象图元对象,空数组表示获取失败
如若传入多个图元 ID,任意图元 ID 未匹配到不影响其它图元的返回,即可能返回少于传入的图元 ID 数量的图元对象
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
获取所有二进制内嵌对象
getAll(layer?: TPCB_LayersOfObject, primitiveLock?: boolean): Promise<Array<IPCB_PrimitiveObject>>;|
Parameter |
Type |
Description |
|---|---|---|
|
layer |
(Optional) 层 | |
|
primitiveLock |
boolean |
(Optional) 是否锁定 |
Promise<Array<IPCB_PrimitiveObject>>
二进制内嵌对象图元对象数组
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
获取所有二进制内嵌对象的图元 ID
getAllPrimitiveId(layer?: TPCB_LayersOfObject, primitiveLock?: boolean): Promise<Array<string>>;|
Parameter |
Type |
Description |
|---|---|---|
|
layer |
(Optional) 层 | |
|
primitiveLock |
boolean |
(Optional) 是否锁定 |
Promise<Array<string>>
二进制内嵌对象的图元 ID 数组
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
修改二进制内嵌对象
modify(primitiveId: string | IPCB_PrimitiveObject, property: {
layer?: TPCB_LayersOfObject;
topLeftX?: number;
topLeftY?: number;
binaryData?: string;
width?: number;
height?: number;
rotation?: number;
mirror?: boolean;
fileName?: string;
primitiveLock?: boolean;
}): Promise<IPCB_PrimitiveObject | undefined>;|
Parameter |
Type |
Description |
|---|---|---|
|
primitiveId |
string | IPCB_PrimitiveObject |
图元 ID |
|
property |
{ layer?: TPCB_LayersOfObject; topLeftX?: number; topLeftY?: number; binaryData?: string; width?: number; height?: number; rotation?: number; mirror?: boolean; fileName?: string; primitiveLock?: boolean; } |
修改参数 |
Promise<IPCB_PrimitiveObject | undefined>
二进制内嵌对象图元对象,undefined 表示修改失败