Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.

androidx.core.graphics

Classes

BitmapCompat

Helper for accessing features in android.graphics.Bitmap.

BlendModeColorFilterCompat

Helper for accessing ColorFilter APIs on various API levels of the platform

ColorUtils

A set of color-related utility methods, building upon those available in Color.

Insets

An Insets instance holds four integer offsets which describe changes to the four edges of a Rectangle.

PaintCompat

Helper for accessing features in Paint.

PathSegment

A line segment that represents an approximate fraction of a Path after flattening.

PathUtils

A set of path-related utility methods.

TypefaceCompat

Helper for accessing features in Typeface.

Enums

BlendModeCompat

Compat version of android.graphics.BlendMode, usages of BlendModeCompat will map to android.graphics.PorterDuff.Mode wherever possible

Top-level functions summary

Bitmap
createBitmap(width: Int, height: Int, config: Config = Bitmap.Config.ARGB_8888)

Returns a mutable bitmap with the specified width and height.

Bitmap
createBitmap(width: Int, height: Int, config: Config = Bitmap.Config.ARGB_8888, hasAlpha: Boolean = true, colorSpace: ColorSpace = ColorSpace.get(ColorSpace.Named.SRGB))

Returns a mutable bitmap with the specified width and height.

Matrix
rotationMatrix(degrees: Float, px: Float = 0.0f, py: Float = 0.0f)

Creates a rotation matrix, defined by a rotation angle in degrees around the pivot point located at the coordinates (px, py).

Matrix
scaleMatrix(sx: Float = 1.0f, sy: Float = 1.0f)

Creates a scale matrix with the scale factor sx and sy respectively on the x and y axis.

Matrix
translationMatrix(tx: Float = 0.0f, ty: Float = 0.0f)

Creates a translation matrix with the translation amounts tx and ty respectively on the x and y axis.

Extension functions summary

For android.graphics.Bitmap
Bitmap
Bitmap.applyCanvas(block: Canvas.() -> Unit)

Creates a new Canvas to draw on this bitmap and executes the specified block on the newly created canvas.

operator Boolean

Returns true if the specified point is inside the bitmap.

operator Boolean

Returns true if the specified point is inside the bitmap.

operator Int
Bitmap.get(x: Int, y: Int)

Returns the value of the pixel at the specified location.

Bitmap
Bitmap.scale(width: Int, height: Int, filter: Boolean = true)

Creates a new bitmap, scaled from this bitmap, when possible.

operator Unit
Bitmap.set(x: Int, y: Int, @ColorInt color: Int)

Writes the specified color int into the bitmap (assuming it is mutable) at the specified (x, y) coordinate.

For android.graphics.Canvas
Unit
Canvas.withClip(clipRect: Rect, block: Canvas.() -> Unit)

Wrap the specified block in calls to Canvas.save/Canvas.clipRect and Canvas.restoreToCount.

Unit