DingRtcEngineWhiteboard接口

通过阅读本文,您可以了解到iOS SDKMac SDKDingRtcEngineWhiteboard接口详情。

接口说明

目录

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.5

createDoc

基于内容创建白板文档。

3.5

createDocWithExternal

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

3.6

deleteDoc

删除白板文档。

3.6

switchDoc

切换白板文档。

3.6

copyDocPage

复制白板文档页内容。

3.6

saveDocToImages

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

3.6

sendUserMessage

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

3.6

broadcastMessage

广播消息给所有用户。

3.6

setDelegate

设置白板监听器。

3.6

setOption

设置白板参数。

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

接口详情

  • open: 打开白板。

     int open (DingRtcOSView *view)

    参数

    类型

    描述

    view

    DingRtcOSView

    视图。

    返回说明

    • 0:成功;
    • 0:失败。
  • close: 关闭白板。

     int close ()

    返回说明

    • 0:成功;
    • 0:失败。
  • join: 加入白板。

     int join ()

    返回说明

    • 0:成功;
    • 0:失败。
  • leave: 离开白板。

     int leave ()

    返回说明

    • 0:成功;
    • 0:失败。
  • stop: 结束白板。

     int stop ()

    返回说明

    • 0:成功;
    • 0:失败。
  • setRole: 设置白板角色。

     int setRole (DingRtcWbRoleType role)

    参数

    类型

    描述

    role

    DingRtcWbRoleType

    白板角色。

    返回说明

    • 0:成功;
    • 0:失败。
  • setToolType: 设置工具类型。

     int setToolType (DingRtcWbTool toolType)

    参数

    类型

    描述

    toolType

    DingRtcWbTool

    工具类型。

    返回说明

    • 0:成功;
    • 0:失败。
  • setLineWidth: 设置线宽。

     int setLineWidth (int size)

    参数

    类型

    描述

    size

    int

    线宽。有效值为1-20。

    返回说明

    • 0:成功;
    • 0:失败。
  • setColor: 设置颜色。

     int setColor (DingRtcWbColor *color)

    参数

    类型

    描述

    color

    DingRtcWbColor

    颜色。

    返回说明

    • 0:成功;
    • 0:失败。
  • setFillColor: 设置填充颜色。

     int setFillColor (DingRtcWbColor *color)

    参数

    类型

    描述

    color

    DingRtcWbColor

    填充颜色。

    返回说明

    • 0:成功;
    • 0:失败。
  • setFillType: 设置填充类型。

     int setFillType (DingRtcWbFillType type)

    参数

    类型

    描述

    type

    DingRtcWbFillType

    填充类型。

    返回说明

    • 0:成功;
    • 0:失败。
  • setFontStyle: 设置字体样式。

     int setFontStyle (DingRtcWbFontStyle style)

    参数

    类型

    描述

    style

    DingRtcWbFontStyle

    字体样式。

    返回说明

    • 0:成功;
    • 0:失败。
  • setFontSize: 设置字体大小。

     int setFontSize (int size)

    参数

    类型

    描述

    size

    int

    字体大小。

    返回说明

    • 0:成功;
    • 0:失败。
  • undo: 撤消。

     int undo ()

    返回说明

    • 0:成功;
    • 0:失败。
  • redo: 重做。

     int redo ()

    返回说明

    • 0:成功;
    • 0:失败。
  • getToolType: 获取工具类型。

     DingRtcWbTool getToolType ()

    返回说明

    WBToolType 工具类型。

  • getUndoStatus: 是否可以撤消。

     BOOL getUndoStatus ()

    返回说明

    • YES:可以;
    • NO:不可以。
  • getRedoStatus: 是否可以恢复重做。

     BOOL getRedoStatus ()

    返回说明

    • YES:可以;
    • NO:不可以。
  • addStamp: 添加图章资源。

     int addStamp (DingRtcWbStamp *stamp)

    参数

    类型

    描述

    stamp

    DingRtcWbStamp

    图章对象。

    返回说明

    • 0:成功;
    • 0:失败。
  • setStamp: 设置图章资源。

     int setStamp (NSString *stampId)

    参数

    类型

    描述

    stampId

    NSString *

    图章资源ID。

    返回说明

    • 0:成功;
    • 0:失败。
  • setZoomScale: 设置缩放比例。

     int setZoomScale (float scale)

    参数

    类型

    描述

    scale

    float

    缩放比例。

    返回说明

    • 0:成功;
    • 0:失败。
  • setZoomScaleWithTranslate: 设置缩放比例及基于原始中心点缩放后的平移。

     int setZoomScaleWithTranslate (float scale,[tx] float tx,[ty] float ty)

    参数

    类型

    描述

    scale

    float

    缩放比例。

    tx

    float

    缩放后x轴平移。

    ty

    float

    缩放后y轴平移。

    返回说明

    • 0:成功;
    • 0:失败。
  • setMinZoomScale: 设置最小缩放比例。

     int setMinZoomScale (float scale)

    参数

    类型

    描述

    scale

    float

    缩放比例。

    返回说明

    • 0:成功;
    • 0:失败。
  • setMaxZoomScale: 设置最大缩放比例。

     int setMaxZoomScale (float scale)

    参数

    类型

    描述

    scale

    float

    缩放比例。

    返回说明

    • 0:成功;
    • 0:失败。
  • getZoomScale: 获取缩放比例。

     float getZoomScale ()

    返回说明

    缩放比例。

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

     float getMinZoomScale ()

    返回说明

    缩放比例。

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

     float getMaxZoomScale ()

    返回说明

    缩放比例。

  • setScalingMode: 设置缩放模式。

     int setScalingMode (DingRtcWbScalingMode mode)

    参数

    类型

    描述

    mode

    DingRtcWbScalingMode

    缩放模式。

    返回说明

    • 0:成功;
    • 0:失败。
  • getCurrentPageNumber: 获取当前白板页码。

     NSUInteger getCurrentPageNumber ()

    返回说明

    当前白板页码。

  • getTotalNumberOfPages: 获取白板总页数。

     NSUInteger getTotalNumberOfPages ()

    返回说明

    白板总页数。

  • addPage: 添加一页到最后。

     int addPage (BOOL autoSwitch)

    参数

    类型

    描述

    autoSwitch

    BOOL

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

    返回说明

    • 0:成功;
    • 0:失败。
  • insertPage: 插入一页到指定页之后。

     int insertPage (NSUInteger pageNo,[autoSwitch] BOOL autoSwitch)

    参数

    类型

    描述

    pageNo

    NSUInteger

    指定页的页码。

    autoSwitch

    BOOL

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

    返回说明

    • 0:成功;
    • 0:失败。
  • removePage: 删除一页。

     int removePage (NSUInteger pageNo,[switchNext] BOOL switchNext)

    参数

    类型

    描述

    pageNo

    NSUInteger

    被删除页的页码。

    switchNext

    BOOL

    切换到删除页的下一页。

    返回说明

    • 0:成功;
    • 0:失败。
    重要

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

  • gotoPage: 跳转到指定页。

     int gotoPage (NSUInteger pageNo)

    参数

    类型

    描述

    pageNo

    NSUInteger

    跳转页的页码。

    返回说明

    • 0:成功;
    • 0:失败。
  • nextPage: 下一页。

     int nextPage ()

    返回说明

    • 0:成功;
    • 0:失败。
  • prevPage: 上一页。

     int prevPage ()

    返回说明

    • 0:成功;
    • 0:失败。
  • getCurrentDocId: 获取当前白板文档Id。

     NSString * getCurrentDocId ()

    返回说明

    当前白板文档Id。

  • getDocInfo: 获取白板文档信息。

     DingRtcWbDocInfo * getDocInfo (NSString *docId)

    参数

    类型

    描述

    docId

    NSString *

    白板文档Id。

    返回说明

    白板文档信息。

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

     NSArray< NSString * > * getDocList ()

    返回说明

    白板文档ID列表

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

     NSString * createDoc (DingRtcWbDocContents *contents,[autoSwitch] BOOL autoSwitch)

    参数

    类型

    描述

    contents

    DingRtcWbDocContents

    文档信息。

    autoSwitch

    BOOL

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

    返回说明

    const char* 白板文档ID。

    重要

    contents.transDocId不为空,则查询转码文件信息,忽略contents.urls参数

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

     NSString * createDocWithExternal (DingRtcWbDocExtContents *contents,[autoSwitch] BOOL autoSwitch)

    参数

    类型

    描述

    contents

    DingRtcWbDocExtContents

    外部文档信息。

    autoSwitch

    BOOL

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

    返回说明

    白板文档Id。

  • deleteDoc: 删除白板文档。

     int deleteDoc (NSString *docId)

    参数

    类型

    描述

    docId

    NSString *

    白板文档Id。

    返回说明

    • 0:成功;
    • 0:失败。
  • switchDoc: 切换白板文档。

     int switchDoc (NSString *docId)

    参数

    类型

    描述

    docId

    NSString *

    白板文档ID。

    返回说明

    • 0:成功;
    • 0:失败。
  • copyDocPage: 复制白板文档页内容。

     int copyDocPage (NSString *srcDocId,[srcPageNum] NSUInteger srcPageNum,[dstDocId] NSString *dstDocId,[dstPageNum] NSUInteger dstPageNum,[clearDstPage] BOOL clearDstPage)

    参数

    类型

    描述

    srcDocId

    NSString *

    源白板文档ID。

    srcPageNum

    NSUInteger

    源白板文档页码。

    dstDocId

    NSString *

    目标白板文档ID。

    dstPageNum

    NSUInteger

    目标白板文档页码。

    clearDstPage

    BOOL

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

    返回说明

    • 0:成功;
    • 0:失败。
  • saveDocToImages: 保存白板文档为多张图片。

     int saveDocToImages (NSString *docId,[outputDir] NSString *outputDir)

    参数

    类型

    描述

    docId

    NSString *

    白板文档Id。

    outputDir

    NSString *

    输出目录

    返回说明

    • 0:成功;
    • 0:失败。
  • sendUserMessage: 发送自定义消息给指定用户。

     int sendUserMessage (NSString *userId,[msg] NSString *msg)

    参数

    类型

    描述

    userId

    NSString *

    用户Id。

    msg

    NSString *

    要发送的消息,最大不超过16KB。

    返回说明

    • 0:成功;
    • 0:失败。
  • broadcastMessage: 广播消息给所有用户。

     int broadcastMessage (NSString *msg)

    参数

    类型

    描述

    msg

    NSString *

    要发送的消息,最大不超过16KB。

    返回说明

    • 0:成功;
    • 0:失败。
  • setDelegate: 设置白板监听器。

     void setDelegate (id< DingRtcEngineWhiteboardDelegate >_Nullable delegate)

    参数

    类型

    描述

    delegate

    DingRtcEngineWhiteboardDelegate

    用于接收来自白板的事件

  • setOption: 设置白板参数。

     int setOption (DingRtcWbOptionType option,[param] id param)

    参数

    类型

    描述

    option

    DingRtcWbOptionType

    参数类别。

    param

    id

    参数,具体参数需要遵循option定义的参数结构。

    返回说明

    • 0:成功;
    • 0:失败。
  • clearContents: 清除白板内容。

     int clearContents (DingRtcWbClearParam *param)

    参数

    类型

    描述

    param

    DingRtcWbClearParam

    清除参数。

    返回说明

    • 0:成功;
    • 0:失败。
  • startShareVision: 开始视角共享。

     int startShareVision ()

    返回说明

    • 0:成功;
    • 0:失败。
  • stopShareVision: 停止视角共享。

     int stopShareVision ()

    返回说明

    • 0:成功;
    • 0:失败。
  • startFollowVision: 开始视角跟随。

     int startFollowVision ()

    返回说明

    • 0:成功;
    • 0:失败。
  • stopFollowVision: 停止视角跟随。

     int stopFollowVision ()

    返回说明

    • 0:成功;
    • 0:失败。
  • resetVision: 重置视角

     int resetVision ()

    返回说明

    • 0:成功;
    • 0:失败。
  • snapshot: 快照。

     int snapshot (DingRtcWbSnapshotMode mode,[outputDir] NSString *outputDir)

    参数

    类型

    描述

    mode

    DingRtcWbSnapshotMode

    快照模式

    outputDir

    NSString *

    输出目录。

    返回说明

    • 0:成功;
    • 0:失败。
  • setBackgroundColor: 设置背景色。

     int setBackgroundColor (DingRtcWbColor *color)

    参数

    类型

    描述

    color

    DingRtcWbColor

    背景色。

    返回说明

    • 0:成功;
    • 0:失败。
  • setBackgroundImage: 设置背景图片

     int setBackgroundImage (NSString *imageUrl,[pageNo] NSUInteger pageNo)

    参数

    类型

    描述

    imageUrl

    NSString *

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

    pageNo

    NSUInteger

    当前文档页码

    返回说明

    • 0:成功;
    • 0:失败。
  • addImageFile: 添加图片

     int addImageFile (NSString *imageUrl)

    参数

    类型

    描述

    imageUrl

    NSString *

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

    返回说明

    • 0:成功;
    • 0:失败。
  • saveDocToThumbnails: 保存白板文档为多张缩略图。

     int saveDocToThumbnails (NSString *docId,[outputDir] NSString *outputDir)

    参数

    类型

    描述

    docId

    NSString *

    白板文档Id

    outputDir

    NSString *

    输出目录。

    返回说明

    • 0:成功;
    • 0:失败。