Home > LIB_Symbol > getRenderImage
LIB_Symbol.getRenderImage() method
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 the symbol render image
Signature
typescript
function getRenderImage(source: {
symbolUuid: string;
libraryUuid: string;
subPartName?: undefined | string;
}): Promise<Blob | undefined>;1
2
3
4
5
2
3
4
5
Parameters
Parameter | Type | Description |
|---|---|---|
source | { symbolUuid: string; libraryUuid: string; subPartName?: undefined | string } |
Returns
Promise<Blob | undefined>
Symbol render image
Example
javascript
// 1. 列出系统库符号,取一个作为渲染来源
const [source] = await eda.lib_Symbol.search('', undefined, [], undefined, 1, 1);
// 2. 获取渲染图(PNG Blob)
const blob = await eda.lib_Symbol.getRenderImage({
symbolUuid: 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