human: 如何处理七牛云的实时音视频QNVideoWaterMark

gpt: [实时音视频](https://developer.qiniu.com/rtc) > API 文档 > Android >QNVideoWaterMark

#  QNVideoWaterMark

最近更新时间: 2022-05-12 20:09:05

视频水印参数配置类

Index

Core Methods

  * setWaterMarkRelativeSize[1/2]
  * setWaterMarkRelativeSize[2/2]
  * setResourcePath
  * setResourceId
  * setResourceBitmap
  * setWaterMarkPosition
  * setAlpha
  * getAlpha
  * getWaterMarkX
  * getWaterMarkY
  * getWaterMarkRelativeSize

Enum

  * SIZE

Core Methods

setWaterMarkRelativeSize[1/2]

  * [QNVideoWaterMark](https://developer.qiniu.com/rtc/8706/QNVideoWaterMark/8706/QNVideoWaterMark) setWaterMarkRelativeSize([QNVideoWaterMark.SIZE](https://developer.qiniu.com/rtc/8706/QNVideoWaterMark/8706) size)
  * 设置水印图片在视频中的相对大小

其中，[QNVideoWaterMark.SIZE](https://developer.qiniu.com/rtc/8706/QNVideoWaterMark/8706)
的 LARGE、MEDIUM、SMALL 分别对应 0.4f、0.3f 和 0.2f 的相对比例大小

Parameters

    * size: [QNVideoWaterMark.SIZE](https://developer.qiniu.com/rtc/8706/QNVideoWaterMark/8706)

图片相对大小

Returns
[QNVideoWaterMark](https://developer.qiniu.com/rtc/8706/QNVideoWaterMark/8706/QNVideoWaterMark)

setWaterMarkRelativeSize[2/2]

  * [QNVideoWaterMark](https://developer.qiniu.com/rtc/8706/QNVideoWaterMark/8706/QNVideoWaterMark) setWaterMarkRelativeSize(float size)
  * 设置水印图片在视频中的相对大小，范围 (0.0 - 1.0]

Parameters

    * size: float 

图片相对比例

Returns
[QNVideoWaterMark](https://developer.qiniu.com/rtc/8706/QNVideoWaterMark/8706/QNVideoWaterMark)

setResourcePath

  * [QNVideoWaterMark](https://developer.qiniu.com/rtc/8706/QNVideoWaterMark/8706/QNVideoWaterMark) setResourcePath(String absoluteResPath)
  * 设置图片的绝对路径

Parameters

    * absoluteResPath: String 

图片绝对路径

Returns
[QNVideoWaterMark](https://developer.qiniu.com/rtc/8706/QNVideoWaterMark/8706/QNVideoWaterMark)

setResourceId

  * [QNVideoWaterMark](https://developer.qiniu.com/rtc/8706/QNVideoWaterMark/8706/QNVideoWaterMark) setResourceId(int resId)
  * 设置图片的资源 ID

Parameters

    * resId: int 

图片资源 ID

Returns
[QNVideoWaterMark](https://developer.qiniu.com/rtc/8706/QNVideoWaterMark/8706/QNVideoWaterMark)

setResourceBitmap

  * [QNVideoWaterMark](https://developer.qiniu.com/rtc/8706/QNVideoWaterMark/8706/QNVideoWaterMark) setResourceBitmap(Bitmap resBitmap)
  * 设置图片的 Bitmap 对象

Parameters

    * resBitmap: Bitmap 

图片 bitmap

Returns
[QNVideoWaterMark](https://developer.qiniu.com/rtc/8706/QNVideoWaterMark/8706/QNVideoWaterMark)

setWaterMarkPosition

  * [QNVideoWaterMark](https://developer.qiniu.com/rtc/8706/QNVideoWaterMark/8706/QNVideoWaterMark) setWaterMarkPosition(float x, float y)
  * 设置水印图片在显示控件中的位置

显示控件的左上角为原点 [0.0，0.0]，右下角为 [1.0，1.0]

Parameters

    * x: float 

图片 X 坐标值 [0.0 - 1.0]

    * y: float 

图片 Y 坐标值 [0.0 - 1.0]

Returns
[QNVideoWaterMark](https://developer.qiniu.com/rtc/8706/QNVideoWaterMark/8706/QNVideoWaterMark)

setAlpha

  * [QNVideoWaterMark](https://developer.qiniu.com/rtc/8706/QNVideoWaterMark/8706/QNVideoWaterMark) setAlpha(int alpha)
  * 设置水印图片的透明度, [0-255]

Parameters

    * alpha: int 

图片的透明度, [0-255]

Returns
[QNVideoWaterMark](https://developer.qiniu.com/rtc/8706/QNVideoWaterMark/8706/QNVideoWaterMark)

getAlpha

  * int getAlpha()
  * 获取水印透明度

Returns int

getWaterMarkX

  * float getWaterMarkX()
  * 获取水印 X 坐标值

Returns float

getWaterMarkY

  * float getWaterMarkY()
  * 获取水印 Y 坐标值

Returns float

getWaterMarkRelativeSize

  * float getWaterMarkRelativeSize()
  * 获取水印相对大小

Returns float

Enum

SIZE

  * SIZE: enum
  * Type declaration

    * LARGE

    * MEDIUM

    * SMALL

以上内容是否对您有帮助？