Tutorial by Examples

You can create a new paint with one of these 3 constructors: new Paint() Create with default settings new Paint(int flags) Create with flags new Paint(Paint from) Copy settings from another paint It is generally suggested to never create a paint object, or any other object in onDraw() as it ...
Text drawing settings setTypeface(Typeface typeface) Set the font face. See Typeface setTextSize(int size) Set the font size, in pixels. setColor(int color) Set the paint drawing color, including the text color. You can also use setARGB(int a, int r, int g, int b and setAlpha(int alpha) setLet...
setStyle(Paint.Style style) Filled shape FILL, Stroke shape STROKE, or both FILL_AND_STROKE setColor(int color) Set the paint drawing color. You can also use setARGB(int a, int r, int g, int b and setAlpha(int alpha) setStrokeCap(Paint.Cap cap) Set line caps, either ROUND, SQUARE, or BUTT (none)...
You can set the following flags in the constructor, or with setFlags(int flags) Paint.ANTI_ALIAS_FLAG Enable antialiasing, smooths the drawing. Paint.DITHER_FLAG Enable dithering. If color precision is higher than the device's, this will happen. Paint.EMBEDDED_BITMAP_TEXT_FLAG Enables the use o...

Page 1 of 1