Drawable

fun Drawable(    @DrawableOrDrawableRes drawable: Any,     position: WatermarkPosition = WatermarkPosition.MIDDLE_CENTER,     width: Float = 0.0f,     height: Float = 0.0f,     dx: Float = 0.0f,     dy: Float = 0.0f,     rotation: Float = 0.0f,     @FloatRange(from = 0.0, to = 1.0) opacity: Float = 1.0f,     measurementDimension: Dimension = Dimension.PX)

Parameters

drawable

Drawable resource or object for the watermark.

position

Position for the watermark inside of the image.

width

Width for the watermark, if the value is zero, the intrinsic width of the drawable will be used. If the drawable has no intrinsic width, such as a solid color, an exception will be thrown.

height

Height for the watermark, if the value is zero, the intrinsic height of the drawable will be used. If the drawable has no intrinsic height, such as a solid color, an exception will be thrown.

dx

Watermark offset for the x-axis.

dy

Watermark offset for the y-axis.

rotation

Rotation in degrees for the watermark.

opacity

Opacity of the watermark. This is a value from 0 to 1, where 0 means the watermark is completely transparent and 1 means the watermark is completely opaque.

measurementDimension

Type of dimension to use to draw watermark, its apply for width, height, dx and dy. For example, if the value of width is 10f and measurementDimension is Dimension.PX, the width of the drawn watermark will be 10 px, but if measurementDimension is Dimension.DP, the the width of the drawn watermark will be calculate according the screen density. It is recommended to use only Dimension.PX or Dimension.DP for a Drawable watermark.