Essential Android Paint edit forum

Setting flags

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(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


Table Of Contents
39 ACRA
64 Menu
112 Loader
119 Xposed
132 Colors
135 Fresco
140 AdMob
147 Button
156 Vk SDK
170 XMPP
176 OpenCV
200 FileIO
203 Moshi
217 Paint
231 AIDL
241 JCodec
243 Okio
255 Looper
  ↑ ↓ to navigate     ↵ to select     Esc to close