Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在绘制完成后,是否可以只获取涂鸦的绘制,不带底图的方法 #70

Open
Valor2 opened this issue Jun 1, 2022 · 1 comment

Comments

@Valor2
Copy link

Valor2 commented Jun 1, 2022

看了公开方法,绘制完成后获取图片的时候 只有两种,包含涂鸦 和不包含涂鸦,是否还是第三种,只包含涂鸦

@anjiemo
Copy link

anjiemo commented Aug 2, 2023

可以参照源码获取到涂鸦的路径,然后绘制到自己的 Canvas 上,如下代码所示

    val newBitmap = Bitmap.createBitmap(bitmap.width, bitmap.height, Bitmap.Config.ARGB_8888)
    val canvas = Canvas(newBitmap)
    val paint = Paint()
    paint.color = Color.BLACK
    canvas.drawRect(0f, 0f, bitmap.width.toFloat(), bitmap.height.toFloat(), paint)
    mDoodleView.allItem.forEach { it.draw(canvas) }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants