Home > LIB_Footprint > getRenderImage
LIB_Footprint.getRenderImage() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
获取封装渲染图
签名
typescript
function getRenderImage(source: {
footprintUuid: string;
libraryUuid: string;
}): Promise<Blob | undefined>;1
2
3
4
2
3
4
参数名
参数 | 类型 | 描述 |
|---|---|---|
source | { footprintUuid: string; libraryUuid: string } |
返回值
Promise<Blob | undefined>
封装渲染图
示例
javascript
// 1. 搜索系统库,取一个封装作为渲染来源
const [source] = await eda.lib_Footprint.search('0402', undefined, undefined, 1, 1);
// 2. 获取渲染图(PNG Blob)
const blob = await eda.lib_Footprint.getRenderImage({
footprintUuid: source.uuid,
libraryUuid: source.libraryUuid,
});
// 3. Blob 可转成 URL 直接展示:URL.createObjectURL(blob)
console.log('sourceName:', source.name);
console.log('imageSize:', blob.size);
console.log('imageType:', blob.type);1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13