Home > IPCB_PrimitiveObject > getState_Height
IPCB_PrimitiveObject.getState_Height() method
Get the property state: height
Signature
typescript
function getState_Height(): number;1
Returns
number
Height
Example
javascript
// 1. 生成本次运行专用的坐标,在顶层丝印层放置一个 400 x 300 的内嵌图片
const x = 2000 + Math.floor(Math.random() * 100000);
const y = 2000 + Math.floor(Math.random() * 100000);
// 4x4 纯色 PNG 的 data URI(binaryData 必须是 data URI 格式,裸 base64 会创建失败)
const imageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAEElEQVR4nGP4z8AARwzEcQCukw/x0F8jngAAAABJRU5ErkJggg==';
const obj = await eda.pcb_PrimitiveObject.create(3, x, y, imageData, 400, 300, 0, false, 'demo.png', false);
// 2. 读取图片高度
const height = obj.getState_Height();
// 3. 清理测试图元(查询类案例不留测试对象)
await eda.pcb_PrimitiveObject.delete([obj.getState_PrimitiveId()]);
console.log('height:', height);1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14