CanvasEditor
CanvasEditor copied to clipboard
Is there any way to make the canvas background transparent?
Please provide a way to edit or change the Paintview class's init method:
fun initCanvas() { extraBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888) extraCanvas = Canvas(extraBitmap) extraCanvas.drawColor(ContextCompat.getColor(context, android.R.color.white)) invalidate() }
set canvas background color transparent in your fragment class.
canvas.setBackgroundColor(
ContextCompat.getColor(
requireContext(),
android.R.color.transparent
)
)
The also set PaintView background color in CanvasEditorView class:
mPaintView.setBackgroundColor(ContextCompat.getColor(context, android.R.color.transparent))