I am using 2 bitmaps, One for, Image and second for, Border. For Outer Border I used, matrix and paint, to Draw Storked bitmap into, onDraw function. I used below code and I got this output
if (drawBorder == 1) {
val mCurrentScale = getCurrentScale()
val imageBitmapWidth = mCurrentScale * mBorderBitmap!!.width
val borderBitmapWidth = mCurrentScale * (mBorderBitmap!!.width + (dpToPx(mBorderSize) * 2F))
val imageBitmapHeight = mCurrentScale * mBorderBitmap!!.height
if (baseWidth == 0F)
baseWidth = imageBitmapWidth
if (baseHeight == 0F)
baseHeight = imageBitmapHeight
mBorderMatrix.set(bitmapMatrix)
mBorderMatrix.postScale(
borderBitmapWidth / baseWidth,
borderBitmapWidth / baseWidth,
centerX, centerY
)
canvas.drawBitmap(mBorderBitmap!!, mBorderMatrix, borderPaint)
}
You can see in this Video, the border it will increase inner and outer both side. but I want only Outerside. Please help me.