WebCAD-Lib-TS API 文档 - v1.0.0
    Preparing search index...

    Class ImageSource

    图像数据类 用于管理CAD中的图像数据,包括base64编码、文件类型等 PixiJS v8: 使用 Texture 替代 BaseTexture,使用 ImageSource (TextureSource) 作为纹理源

    Index

    Constructors

    • 构造函数

      Parameters

      • imageName: string

        图像名称

      • fileType: string

        文件类型

      • base64Data: string

        base64编码数据

      Returns ImageSource

    Properties

    base64: string
    id: number
    name: string
    ext: string
    ftype: string
    url: string
    width: number
    height: number
    size: number
    texture?: Texture

    PixiJS v8: 使用 Texture 替代 BaseTexture

    textureSource?: ImageSource

    PixiJS v8: 纹理源,用于创建 Texture 实例

    Accessors

    • get mime(): string

      获取MIME类型

      Returns string

      MIME类型

    • get baseTexture(): ImageSource

      获取基础纹理源 (兼容性属性) PixiJS v8: 返回 textureSource 用于创建新的 Texture 实例 使用 textureSource 属性替代

      Returns ImageSource

    • set baseTexture(value: ImageSource): void

      Parameters

      • value: ImageSource

      Returns void

    Methods

    • 将二进制字符串转换为ArrayBuffer

      Parameters

      • binaryString: string

        二进制字符串

      Returns Uint8Array

      字节数组

    • 初始化图像URL

      Parameters

      • base64Data: string

        base64编码数据

      Returns void

    • 异步初始化纹理 PixiJS v8: 使用 HTMLImageElement 加载图像,然后手动创建 ImageSource 和 Texture 这种方式支持 blob URL,比 Assets.load() 更可靠

      Returns Promise<Texture<TextureSource<any>>>

      返回纹理对象的Promise

    • 检查是否可以清除 检查当前文档中是否还有引用此图像的实体

      Returns boolean

      是否可以清除

    • 异步克隆对象

      Returns Promise<ImageSource>

      返回克隆对象的Promise

    • 转换为数据库对象

      Returns DbImage

      数据库对象

    • 释放底层纹理及对象URL,避免占用 GPU/内存

      Returns void