DingRtcEngineWhiteboard接口

通过阅读本文,您可以了解到Android SDK的白板接口详情。

接口说明

目录

API

描述

支持的最低版本

open

打开白板。

3.6

close

关闭白板。

3.6

join

加入白板。

3.6

leave

离开白板。

3.6

stop

结束白板。

3.6

setRole

设置白板角色。

3.6

setToolType

设置工具类型。

3.6

setLineWidth

设置线宽。

3.6

setColor

设置颜色。

3.6

setFillColor

设置填充颜色。

3.6

setFillType

设置填充类型。

3.6

setFontStyle

设置字体样式。

3.6

setFontSize

设置字体大小。

3.6

undo

撤消。

3.6

redo

重做。

3.6

getToolType

获取工具类型。

3.6

getUndoStatus

是否可以撤消。

3.6

getRedoStatus

是否可以恢复重做。

3.6

addStamp

添加图章资源。

3.6

setStamp

设置图章资源。

3.6

setZoomScale

设置缩放比例。

3.6

setZoomScaleWithTranslate

设置缩放比例及基于原始中心点缩放后的平移。

3.6

setMinZoomScale

设置最小缩放比例。

3.6

setMaxZoomScale

设置最大缩放比例。

3.6

getZoomScale

获取缩放比例。

3.6

getMinZoomScale

获取最小缩放比例。

3.6

getMaxZoomScale

获取最大缩放比例。

3.6

setScalingMode

设置缩放模式。

3.6

getCurrentPageNumber

获取当前白板页码。

3.6

getTotalNumberOfPages

获取白板页数。

3.6

addPage

添加一页到最后。

3.6

insertPage

插入一页到指定页之后。

3.6

removePage

删除一页。

3.6

gotoPage

跳转到指定页。

3.6

nextPage

下一页。

3.6

prevPage

上一页。

3.6

getCurrentDocID

获取当前白板文档ID。

3.6

getDocInfo

获取白板信息。

3.6

getDocList

获取白板文档列表。

3.6

createDoc

基于外部内容创建白板文档。

3.6

createDoc

基于内容创建白板文档。

3.6

deleteDoc

删除白板文档。

3.6

switchDoc

切换白板文档。

3.6

copyDocPage

复制白板文档页内容。

3.6

saveDocToImages

保存白板文档为多张图片。

3.6

sendUserMessage

发送自定义消息给指定用户。

3.6

broadcastMessage

广播消息给所有用户。

3.6

setIntOption

设置白板整数类型参数。

3.6

setBooleanOption

设置白板布尔类型参数。

3.6

setFloatOption

设置白板浮点类型参数。

3.6

setStringOption

设置白板字符串类型参数。

3.6

clearContents

清除白板内容。

3.6

startShareVision

开始视角共享。

3.6

stopShareVision

停止视角共享。

3.6

startFollowVision

开始视角跟随。

3.6

stopFollowVision

停止视角跟随。

3.6

resetVision

重置视角。

3.6

snapshot

快照。

3.6

setBackgroundColor

设置背景色。

3.6

setBackgroundImage

设置背景图片

3.6

addImageFile

添加图片

3.6

saveDocToThumbnails

保存白板文档为多张缩略图。

3.6

destroy

销毁白板。

3.6

接口详情

  • open: 打开白板。

     public int open (DingRtcWhiteboardView view)

    返回说明

    0:成功;<0:失败。

  • close: 关闭白板。

     public int close ()

    返回说明

    0:成功;<0:失败。

  • join: 加入白板。

     public int join ()

    返回说明

    0:成功;<0:失败。

  • leave: 离开白板。

     public int leave ()

    返回说明

    0:成功;<0:失败。

  • stop: 结束白板。

     public int stop ()

    返回说明

    0:成功;<0:失败。

  • setRole: 设置白板角色。

     public int setRole (DingRtcWBRoleType role)

    参数

    类型

    描述

    role

    DingRtcWBRoleType

    白板角色

    返回说明

    0:成功;<0:失败。

  • setToolType: 设置工具类型。

     public int setToolType (DingRtcWBToolType toolType)

    参数

    类型

    描述

    toolType

    DingRtcWBToolType

    工具类型。

    返回说明

    0:成功;<0:失败。

  • setLineWidth: 设置线宽。

     public int setLineWidth (int size)

    参数

    类型

    描述

    size

    int

    线宽。有效值为1-20。

    返回说明

    0:成功;<0:失败。

  • setColor: 设置颜色。

     public int setColor (DingRtcWBColor color)

    参数

    类型

    描述

    color

    DingRtcWBColor

    颜色。

    返回说明

    0:成功;<0:失败。

  • setFillColor: 设置填充颜色。

     public int setFillColor (DingRtcWBColor color)

    参数

    类型

    描述

    color

    DingRtcWBColor

    填充颜色。

    返回说明

    0:成功;<0:失败。

  • setFillType: 设置填充类型。

     public int setFillType (DingRtcWBFillType type)

    参数

    类型

    描述

    type

    DingRtcWBFillType

    填充类型。

    返回说明

    0:成功;<0:失败。

  • setFontStyle: 设置字体样式。

     public int setFontStyle (DingRtcWBFontStyle style)

    参数

    类型

    描述

    style

    DingRtcWBFontStyle

    字体样式。

    返回说明

    0:成功;<0:失败。

  • setFontSize: 设置字体大小。

     public int setFontSize (int size)

    参数

    类型

    描述

    size

    int

    字体大小。

    返回说明

    0:成功;<0:失败。

  • undo: 撤消。

     public int undo ()

    返回说明

    0:成功;<0:失败。

  • redo: 重做。

     public int redo ()

    返回说明

    0:成功;<0:失败。

  • getToolType: 获取工具类型。

     public DingRtcWBToolType getToolType ()

    返回说明

    WBToolType 工具类型。

  • getUndoStatus: 是否可以撤消。

     public boolean getUndoStatus ()

    返回说明

    bool

  • getRedoStatus: 是否可以恢复重做。

     public boolean getRedoStatus ()

    返回说明

    bool

  • addStamp: 添加图章资源。

     public int addStamp (DingRtcWBStamp stamp)

    参数

    类型

    描述

    stamp

    DingRtcWBStamp

    图章。

    返回说明

    int

  • setStamp: 设置图章资源。

     public int setStamp (String stampId)

    参数

    类型

    描述

    stampId

    String

    图章资源ID。

    返回说明

    int

  • setZoomScale: 设置缩放比例。

     public int setZoomScale (float scale)

    参数

    类型

    描述

    scale

    float

    缩放比例。

    返回说明

    0:成功;<0:失败。

  • setZoomScaleWithTranslate: 设置缩放比例及基于原始中心点缩放后的平移。

     public int setZoomScaleWithTranslate (float scale, float tx, float ty)

    参数

    类型

    描述

    scale

    float

    缩放比例。

    tx

    float

    缩放后x轴平移。

    ty

    float

    缩放后y轴平移。

    返回说明

    0:成功;<0:失败。

  • setMinZoomScale: 设置最小缩放比例。

     public int setMinZoomScale (float scale)

    参数

    类型

    描述

    scale

    float

    缩放比例。

    返回说明

    0:成功;<0:失败。

  • setMaxZoomScale: 设置最大缩放比例。

     public int setMaxZoomScale (float scale)

    参数

    类型

    描述

    scale

    float

    缩放比例。

    返回说明

    0:成功;<0:失败。

  • getZoomScale: 获取缩放比例。

     public float getZoomScale ()

    返回说明

    scale 缩放比例。

  • getMinZoomScale: 获取最小缩放比例。

     public float getMinZoomScale ()

    返回说明

    scale 缩放比例。

  • getMaxZoomScale: 获取最大缩放比例。

     public float getMaxZoomScale ()

    返回说明

    scale 缩放比例。

  • setScalingMode: 设置缩放模式。

     public int setScalingMode (DingRtcWBScalingMode mode)

    参数

    类型

    描述

    mode

    DingRtcWBScalingMode

    缩放模式。

    返回说明

    0:成功;<0:失败。

  • getCurrentPageNumber: 获取当前白板页码。

     public int getCurrentPageNumber ()

    返回说明

    WBPageNumber

  • getTotalNumberOfPages: 获取白板页数。

     public int getTotalNumberOfPages ()

    返回说明

    0:成功;<0:失败。

  • addPage: 添加一页到最后。

     public int addPage (boolean autoSwitch)

    参数

    类型

    描述

    autoSwitch

    boolean

    自动切换到新添加的页面。

    返回说明

    0:成功;<0:失败。

  • insertPage: 插入一页到指定页之后。

     public int insertPage (int pageNo, boolean autoSwitch)

    参数

    类型

    描述

    pageNo

    int

    指定页的页码。

    autoSwitch

    boolean

    自动切换到新添加的页面。

    返回说明

    0:成功;<0:失败。

  • removePage: 删除一页。

     public int removePage (int pageNo, boolean switchNext)

    参数

    类型

    描述

    pageNo

    int

    被删除页的页码。

    switchNext

    boolean

    切换到删除页的下一页。

    返回说明

    0:成功;<0:失败。

    重要

    删除页的默认行为是切换到删除页的前一页。设置switchNexttrue改为切换到删除页的下一页。

  • gotoPage: 跳转到指定页。

     public int gotoPage (int pageNo)

    参数

    类型

    描述

    pageNo

    int

    跳转页的页码。

    返回说明

    0:成功;<0:失败。

  • nextPage: 下一页。

     public int nextPage ()

    返回说明

    0:成功;<0:失败。

  • prevPage: 上一页。

     public int prevPage ()

    返回说明

    0:成功;<0:失败。

  • getCurrentDocID: 获取当前白板文档ID。

     public String getCurrentDocID ()

    返回说明

    const char*

  • getDocInfo: 获取白板信息。

     public DingRtcWhiteboardDocInfo getDocInfo (String docId)

    参数

    类型

    描述

    docId

    String

    白板文档ID。

    返回说明

    WBDocInfo*

  • getDocList: 获取白板文档列表。

     public List< String > getDocList ()

    返回说明

    白板文档列表

  • createDoc: 基于外部内容创建白板文档。

     public String createDoc (DingRtcWBDocExtContents contents, boolean autoSwitch)

    参数

    类型

    描述

    contents

    DingRtcWBDocExtContents

    外部文档信息。

    autoSwitch

    boolean

    自动切换到新创建的文档。

    返回说明

    const char* 白板文档ID。

  • createDoc: 基于内容创建白板文档。

     public String createDoc (DingRtcWBDocContents contents, boolean autoSwitch)

    参数

    类型

    描述

    contents

    DingRtcWBDocContents

    文档信息。

    autoSwitch

    boolean

    自动切换到新创建的文档。

    返回说明

    const char* 白板文档ID。

  • deleteDoc: 删除白板文档。

     public int deleteDoc (String docId)

    参数

    类型

    描述

    docId

    String

    白板文档ID。

    返回说明

    0:成功;<0:失败。

  • switchDoc: 切换白板文档。

     public int switchDoc (String docId)

    参数

    类型

    描述

    docId

    String

    白板文档ID。

    返回说明

    0:成功;<0:失败。

  • copyDocPage: 复制白板文档页内容。

     public int copyDocPage (String srcDocId, int srcPageNum, String dstDocId, int dstPageNum, boolean clearDstPage)

    参数

    类型

    描述

    srcDocId

    String

    源白板文档ID。

    srcPageNum

    int

    源白板文档页码。

    dstDocId

    String

    目标白板文档ID。

    dstPageNum

    int

    目标白板文档页码。

    clearDstPage

    boolean

    是否清空目标白板文档页。

    返回说明

    0:成功;<0:失败。

  • saveDocToImages: 保存白板文档为多张图片。

     public int saveDocToImages (String docId, String outputDir)

    参数

    类型

    描述

    docId

    String

    白板文档ID。

    outputDir

    String

    输出目录

    返回说明

    0:成功;<0:失败。

  • sendUserMessage: 发送自定义消息给指定用户。

     public int sendUserMessage (String userId, String msg, int size)

    参数

    类型

    描述

    userId

    String

    用户ID。

    msg

    String

    要发送的消息。

    size

    int

    消息大小,最大不超过16KB。

    返回说明

    0:成功;<0:失败。

  • broadcastMessage: 广播消息给所有用户。

     public int broadcastMessage (String msg, int size)

    参数

    类型

    描述

    msg

    String

    要发送的消息。

    size

    int

    消息大小,最大不超过16KB。

    返回说明

    0:成功;<0:失败。

  • setIntOption: 设置白板整数类型参数。

     public int setIntOption (DingRtcWBOption option, int param)

    参数

    类型

    描述

    option

    DingRtcWBOption

    参数类别。

    param

    int

    整数类型参数。

    返回说明

    0:成功;<0:失败。

  • setBooleanOption: 设置白板布尔类型参数。

     public int setBooleanOption (DingRtcWBOption option, boolean param)

    参数

    类型

    描述

    option

    DingRtcWBOption

    参数类别。

    param

    boolean

    布尔类型参数。

    返回说明

    0:成功;<0:失败。

  • setFloatOption: 设置白板浮点类型参数。

     public int setFloatOption (DingRtcWBOption option, float param)

    参数

    类型

    描述

    option

    DingRtcWBOption

    参数类别。

    param

    float

    浮点类型参数。

    返回说明

    0:成功;<0:失败。

  • setStringOption: 设置白板字符串类型参数。

     public int setStringOption (DingRtcWBOption option, String param)

    参数

    类型

    描述

    option

    DingRtcWBOption

    参数类别。

    param

    String

    字符串类型参数。

    返回说明

    0:成功;<0:失败。

  • clearContents: 清除白板内容。

     public int clearContents (DingRtcWBClearParam param)

    参数

    类型

    描述

    param

    DingRtcWBClearParam

    清除参数。

    返回说明

    0:成功;<0:失败。

  • startShareVision: 开始视角共享。

     public int startShareVision ()

    返回说明

    0:成功;<0:失败。

  • stopShareVision: 停止视角共享。

     public int stopShareVision ()

    返回说明

    0:成功;<0:失败。

  • startFollowVision: 开始视角跟随。

     public int startFollowVision ()

    返回说明

    0:成功;<0:失败。

  • stopFollowVision: 停止视角跟随。

     public int stopFollowVision ()

    返回说明

    0:成功;<0:失败。

  • resetVision: 重置视角。

     public int resetVision ()

    返回说明

    0:成功;<0:失败。

  • snapshot: 快照。

     public int snapshot (DingRtcWBSnapshotMode mode, String outputDir)

    参数

    类型

    描述

    mode

    DingRtcWBSnapshotMode

    outputDir

    String

    输出目录。

    返回说明

    0:成功;<0:失败。

  • setBackgroundColor: 设置背景色。

     public int setBackgroundColor (DingRtcWBColor color)

    参数

    类型

    描述

    color

    DingRtcWBColor

    背景色。

    返回说明

    0:成功;<0:失败。

  • setBackgroundImage: 设置背景图片

     public int setBackgroundImage (String imageUrl, int pageNo)

    参数

    类型

    描述

    imageUrl

    String

    图片地址,可以为本地路径或网络路径

    pageNo

    int

    当前文档页码

    返回说明

    int

  • addImageFile: 添加图片

     public int addImageFile (String imageUrl)

    参数

    类型

    描述

    filePath

    图片地址,可以为本地路径或网络路径

    返回说明

    int

  • saveDocToThumbnails: 保存白板文档为多张缩略图。

     public int saveDocToThumbnails (String docId, String outputDir)

    参数

    类型

    描述

    docId

    String

    白板文档ID。

    outputDir

    String

    输出目录。

    返回说明

    0:成功;<0:失败。

  • destroy: 销毁白板。

     public void destroy ()

    返回说明

    void