CanvasCompat

public class CanvasCompat
extends Object

java.lang.Object
   ↳ com.google.android.material.canvas.CanvasCompat


Compat methods for Canvas.

Summary

Public methods

static int saveLayerAlpha(Canvas canvas, RectF bounds, int alpha)

Convenience for saveLayer(RectF, Paint) but instead of taking a entire Paint object it takes only the alpha parameter.

static int saveLayerAlpha(Canvas canvas, float left, float top, float right, float bottom, int alpha)

Convenience for saveLayerAlpha(Canvas, RectF, int) that takes the four float coordinates of the bounds rectangle.

Inherited methods

From class java.lang.Object

Public methods

saveLayerAlpha

int saveLayerAlpha (Canvas canvas, 
                RectF bounds, 
                int alpha)

Convenience for saveLayer(RectF, Paint) but instead of taking a entire Paint object it takes only the alpha parameter.

Parameters
canvas Canvas

bounds RectF

alpha int

Returns
int

saveLayerAlpha

int saveLayerAlpha (Canvas canvas, 
                float left, 
                float top, 
                float right, 
                float bottom, 
                int alpha)

Convenience for saveLayerAlpha(Canvas, RectF, int) that takes the four float coordinates of the bounds rectangle.

Parameters
canvas Canvas

left float

top float

right float

bottom float

alpha int

Returns
int