Android equivalent for HTML5 Canvas CompositeOperation
In HTML5/JavaScript there is this property
compositeoperation
for the c开发者_如何学Goanvas
that sets the mode for putting graphics on the canvas (add/xor/over etc...).
What is the equivalent of this behaviour for Androids Canvas
class?
Or do I need to approach it in a different way to achieve the same results as this property?
(My Java-knowledge is like null++)
do you want to work with the java canvas class or with the HTML5 Canvas class?
for me, it sound like you should build an android webapp ( http://developer.android.com/guide/webapps/index.html ). Within a webapp, you are free to use all HTML5 features as you already know them.
You can even use phonegap in order to access the android hardware easier than with a normal android webapp.
btw: there is a good book about android development with HTML5 : http://ofps.oreilly.com/titles/9781449383268/
Anyway, I found it after an evening of reading, So I answer my own question:
PorterDuffXfermode is the equivalent. (A bit deeper and decoupled than in Javascript.Canvas)
精彩评论