Code example for Paint

Methods: setAntiAliassetColorsetPathEffectsetShadowLayersetStrokeWidthsetStyle

0
 
public class PathView extends View {
 
	private static final int DEFAULT_COLOR = 0xBB489FFF;
 
	private Paint paint = new Paint();
	private Path originalPath = new Path();
	private Path drawingPath = new Path();
 
	private double scale = 1;
 
	public PathView( Context context ) {
		super( context );
		setWillNotDraw( false );
		paint.setStyle( Paint.Style.STROKE );
		paint.setAntiAlias( true );
		paint.setColor( DEFAULT_COLOR );
		paint.setStrokeWidth( 7 );
		paint.setShadowLayer( 4, 2, 2, 0x66000000 );
		paint.setPathEffect( new CornerPathEffect( 5 ) );
	} 
 
	public void setColor( int c ) {
		paint.setColor( c );
		invalidate();
Experience pair programming with AI  Get Codota for Java