DJI Mobile SDK Documentation

      class DrawingTextInfo

      @Keep
      class DrawingTextInfo implements Parcelable
      Package:dji.open.pilot.base.ui.cameraview
      Description:

      Custom text overlay information, used to overlay and display text on the camera view in real time.

      Supported since MSDK 5.20.1

      Class Members:

      Members

      final ALIGN_LEFT
      static final int ALIGN_LEFT   = 0
      Package:dji.open.pilot.base.ui.cameraview
      Description:

      Horizontal alignment: the anchor is the left edge of the text.

      final ALIGN_CENTER
      static final int ALIGN_CENTER = 1
      Package:dji.open.pilot.base.ui.cameraview
      Description:

      Horizontal alignment: the anchor is the horizontal center of the text.

      final ALIGN_RIGHT
      static final int ALIGN_RIGHT  = 2
      Package:dji.open.pilot.base.ui.cameraview
      Description:

      Horizontal alignment: the anchor is the right edge of the text.

      method
      method getAnchor
      OpenPoint getAnchor() 
      Package:dji.open.pilot.base.ui.cameraview
      Description:

      Gets the text anchor coordinates.

      Supported since MSDK 5.20.1

      Return:
      OpenPointThe anchor coordinates (normalized, 0.0 to 1.0). The horizontal meaning is determined by horizontalAlignment, and the vertical direction is fixed as the vertical center of the whole text.
      method
      method setAnchor
      void setAnchor(OpenPoint anchor) 
      Package:dji.open.pilot.base.ui.cameraview
      Description:

      Sets the text anchor coordinates.

      Supported since MSDK 5.20.1

      Input Parameters:
      OpenPoint anchorThe anchor coordinates (normalized, 0.0 to 1.0). The horizontal meaning is determined by horizontalAlignment, and the vertical direction is fixed as the vertical center of the whole text.
      method
      method getText
      String getText() 
      Package:dji.open.pilot.base.ui.cameraview
      Description:

      Gets the text content.

      Supported since MSDK 5.20.1

      Return:
      StringThe text content. Line breaks with \n are supported. Nothing is drawn when it is an empty string.
      method
      method setText
      void setText(String text) 
      Package:dji.open.pilot.base.ui.cameraview
      Description:

      Sets the text content.

      Supported since MSDK 5.20.1

      Input Parameters:
      String textThe text content. Line breaks with \n are supported. Nothing is drawn when it is an empty string.
      method getTextSize
      float getTextSize() 
      Package:dji.open.pilot.base.ui.cameraview
      Description:

      Gets the font size.

      Supported since MSDK 5.20.1

      Return:
      floatThe font size (in sp).
      method setTextSize
      void setTextSize(float textSize) 
      Package:dji.open.pilot.base.ui.cameraview
      Description:

      Sets the font size.

      Supported since MSDK 5.20.1

      Input Parameters:
      float textSizeThe font size (in sp).
      method getTextColor
      int getTextColor() 
      Package:dji.open.pilot.base.ui.cameraview
      Description:

      Gets the text color.

      Supported since MSDK 5.20.1

      Return:
      intThe text color (ARGB).
      method setTextColor
      void setTextColor(int textColor) 
      Package:dji.open.pilot.base.ui.cameraview
      Description:

      Sets the text color.

      Supported since MSDK 5.20.1

      Input Parameters:
      int textColorThe text color (ARGB).
      method getBackgroundColor
      int getBackgroundColor() 
      Package:dji.open.pilot.base.ui.cameraview
      Description:

      Gets the text background color.

      Supported since MSDK 5.20.1

      Return:
      intThe text background color (ARGB). No background is drawn when the alpha channel is 0.
      method setBackgroundColor
      void setBackgroundColor(int backgroundColor) 
      Package:dji.open.pilot.base.ui.cameraview
      Description:

      Sets the text background color.

      Supported since MSDK 5.20.1

      Input Parameters:
      int backgroundColorThe text background color (ARGB). No background is drawn when the alpha channel is 0.
      method getHorizontalAlignment
      int getHorizontalAlignment() 
      Package:dji.open.pilot.base.ui.cameraview
      Description:

      Gets the horizontal alignment.

      Supported since MSDK 5.20.1

      Return:
      intThe horizontal alignment. The value is one of ALIGN_LEFT, ALIGN_CENTER, or ALIGN_RIGHT.
      method setHorizontalAlignment
      void setHorizontalAlignment(int horizontalAlignment) 
      Package:dji.open.pilot.base.ui.cameraview
      Description:

      Sets the horizontal alignment.

      Supported since MSDK 5.20.1

      Input Parameters:
      int horizontalAlignmentThe horizontal alignment. The value is one of ALIGN_LEFT, ALIGN_CENTER, or ALIGN_RIGHT.