Setting flags

suggest change

You can set the following flags in the constructor, or with setFlags(int flags)

You can add a flag and remove flags like this:

Paint paint = new Paint();
paint.setFlags(paint.getFlags() | Paint.FLAG);   // Add flag
paint.setFlags(paint.getFlags() & ~Paint.FLAG);  // Remove flag

Trying to remove a flag that isn’t there or adding a flag that is already there won’t change anything. Also note that most flags can also be set using set<Flag>(boolean enabled), for example setAntialias(true).

You can use paint.reset() to reset the paint to its default settings. The only default flag is EMBEDDED_BITMAP_TEXT_FLAG. It will be set even if you use new Paint(0), you will have

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents