logo
On this page

Zoom in or out on a whiteboard


This document describes how to zoom the whiteboard being displayed.

Prerequisites

Creat a whiteboard by referring to Create a super board.

Implementation process

The zooming function is enabled by default. The setScaleFactor API can be called to zoom in and out.

Note

If the setToolType is set to Click, the setScaleFactor API is unavailable and the whiteboard cannot be zoomed in or out.

  • Call the setOperationMode method to set the operation mode to ZegoSuperBoardOperationMode.Zoom to enable the zooming function of ZegoSuperBoard.
  • Set multiple modes using the bitwise OR operator based on your requirements. For example, you can set Zoom | Draw to support both the zooming and drawing functions.
// Obtain the current subView using superBoardView.
var zegoSuperBoard = ZegoSuperBoardManager.getInstance()
var zegoSuperBoardSubView = zegoSuperBoard.getSuperBoardView().getCurrentSuperBoardSubView();
if (!zegoSuperBoardSubView) return;

// Enable only the zooming function.
// ZegoSuperBoardOperationMode.Zoom = 8
zegoSuperBoardSubView.setOperationMode(8);

// Enable both the drawing and zooming functions.
// ZegoSuperBoardOperationMode.Draw = 4
// ZegoSuperBoardOperationMode.Zoom = 8
zegoSuperBoardSubView.setOperationMode(4|8);

// Zoom in to 200%.
zegoSuperBoardSubView.setScaleFactor(2);

Use the following methods to enable the synchronous zooming function to synchronously zoom in and out for all parties.

// Enable the synchronous zooming function.
ZegoSuperBoardManager.getInstance().enableSyncScale(true)

// Enable the function of receiving the synchronous zooming effect.
ZegoSuperBoardManager.getInstance().enableResponseScale(true);

Previous

Turn pages on a whiteboard

Next

Switch a whiteboard

On this page

Back to top