与Android上透明漆绘图 [英] Drawing with Transparent Paint on Android

查看:176
本文介绍了与Android上透明漆绘图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用油漆 Col​​or.TRANSPARENT Android中一个普通的2D画布上,我不明白任何结果,我的目的是要摆脱一些的画布上的内容。我的意思是我想处理掉不消失的内容。

这是在code我的油漆

  mPointFillPaint =新的油漆();
mPointFillPaint.setColor(Color.TRANSPARENT);
mPointFillPaint.setAntiAlias​​(真正的);
mPointFillPaint.setStyle(Paint.Style.FILL);
mPointFillPaint.setStrokeJoin(Paint.Join.MITER);
 

解决方案

普莱斯尝试T选用下面的画图。我可以帮助!

  mPaint =新的油漆(Paint.ANTI_ALIAS_FLAG);
    mPaint.setColor(Color.TRANSPARENT);
    mPaint.setXfermode(新PorterDuffXfermode(PorterDuff.Mode.SRC_OUT));
    mPaint.setAntiAlias​​(真正的);
 

When I use Paint with Color.TRANSPARENT on a normal 2D canvas in Android, I don't get any results and my intention was to get rid of some of the contents on the canvas. I mean the contents that I want to dispose of don't disappear.

This is the code for my Paint:

mPointFillPaint = new Paint();
mPointFillPaint.setColor(Color.TRANSPARENT);
mPointFillPaint.setAntiAlias(true);
mPointFillPaint.setStyle(Paint.Style.FILL);
mPointFillPaint.setStrokeJoin(Paint.Join.MITER); 

解决方案

Pleas try t use the following Paint. I may Help.!

mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mPaint.setColor(Color.TRANSPARENT);
    mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OUT));
    mPaint.setAntiAlias(true);

这篇关于与Android上透明漆绘图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆