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

是否可以加入橡皮擦功能? #9

Open
byte-art opened this issue Dec 26, 2018 · 3 comments
Open

是否可以加入橡皮擦功能? #9

byte-art opened this issue Dec 26, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@byte-art
Copy link

如題

@LOWANGA
Copy link

LOWANGA commented Mar 30, 2019

橡皮擦功能 改了paint模式后 不起作用 有什么办法吗

@kofihust
Copy link

橡皮擦功能 改了paint模式后 不起作用 有什么办法吗

有橡皮擦功能吗?

@minetsh minetsh added the enhancement New feature or request label May 14, 2020
@AoEiuV020
Copy link

除了paint模式还要专门创建一层argb8888的画布才能画出透明代表橡皮擦,
我这边基于两年前的版本改的橡皮擦已经能用了,

me.kareluo.imaging.core.IMGPath#onDrawDoodle
            if (color == 0) {
                paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
            } else {
                paint.setXfermode(null);
            }

me.kareluo.imaging.view.IMGView#onSizeChanged
        if (w != oldw || h != oldh) {
            doodleBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
            doodleCanvas = new Canvas(doodleBitmap);
        }

me.kareluo.imaging.view.IMGView#onDrawImages
        doodleBitmap.eraseColor(Color.TRANSPARENT);
        // 涂鸦
        mImage.onDrawDoodles(doodleCanvas);
        canvas.drawBitmap(doodleBitmap, 0, 0, null);

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

No branches or pull requests

5 participants