CropView

class CropView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = R.attr.Default_CropView_Style, defStyleRes: Int = R.style.BaseCropView) : View

Crop view

Since

0.5.0

Constructors

Link copied to clipboard
internal constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = R.attr.Default_CropView_Style, defStyleRes: Int = R.style.BaseCropView)

Properties

Link copied to clipboard
Link copied to clipboard

The crop frame guideline width when the frame type is GRID9.

Link copied to clipboard

The crop frame width. mCropViewWidth and mCropViewHeight are only different when the frame type is RECTANGLE

Link copied to clipboard
private val mCropFramePaint: Paint
Link copied to clipboard

The crop frame stroke width.

Link copied to clipboard

The crop frame stroke corner length when the frame type is GRID9.

Link copied to clipboard
Link copied to clipboard

The crop frame stroke corner width when the frame type is GRID9.

Link copied to clipboard
Link copied to clipboard

The crop frame stroke width.

Link copied to clipboard

The crop frame shape type.

Link copied to clipboard

The crop frame width. mCropViewWidth and mCropViewHeight are only different when the frame type is RECTANGLE

Link copied to clipboard

The crop mask layer color.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The setting value of frame height.

Link copied to clipboard

The setting value of frame width.

Link copied to clipboard
private val mNeededHeight: Float

The minimum height of the CropView.

Link copied to clipboard
private val mNeededWidth: Float

The minimum width of the CropView.

Link copied to clipboard

Functions

Link copied to clipboard
private fun drawBorder(canvas: Canvas, clipRect: Rect)

Draw border when mCropFrameType is CropFrameType.GRID9.

Link copied to clipboard
private fun drawCorners(canvas: Canvas, clipRect: Rect)

Draw corners when mCropFrameType is CropFrameType.GRID9.

Link copied to clipboard
private fun drawGuidelines(canvas: Canvas, clipRect: Rect)

Draw guidelines when mCropFrameType is CropFrameType.GRID9.

Link copied to clipboard
internal fun getCropFrameRect(): Rect

Get crop frame rect.

Link copied to clipboard
protected open override fun onDraw(canvas: Canvas)
Link copied to clipboard
protected open override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int)
Link copied to clipboard
fun setCropFrameSize(@FloatRange(from = 0.0) width: Float, @FloatRange(from = 0.0) height: Float)

Set crop frame size.

Link copied to clipboard

Set crop frame stroke width in pixels.

Link copied to clipboard

Set crop frame shape type.

Link copied to clipboard
fun setCropMaskColor(@ColorInt color: Int, @IntRange(from = 0, to = 100) transparency: Int? = null)

Set crop mask layer color.