androidx.compose.ui.graphics.painter

Classes

BitmapPainter

Painter implementation used to draw an ImageBitmap into the provided canvas This implementation can handle applying alpha and ColorFilter to it's drawn result

Cmn
BrushPainter

Painter implementation used to fill the provided bounds with the specified Brush.

Cmn
ColorPainter

Painter implementation used to fill the provided bounds with the specified color

Cmn
Painter

Abstraction for something that can be drawn.

Cmn

Top-level functions summary

BitmapPainter
BitmapPainter(
    image: ImageBitmap,
    srcOffset: IntOffset,
    srcSize: IntSize,
    filterQuality: FilterQuality
)

Painter implementation used to draw an ImageBitmap into the provided canvas This implementation can handle applying alpha and ColorFilter to it's drawn result

Cmn

Top-level functions

BitmapPainter

fun BitmapPainter(
    image: ImageBitmap,
    srcOffset: IntOffset = IntOffset.Zero,
    srcSize: IntSize = IntSize(image.width, image.height),
    filterQuality: FilterQuality = FilterQuality.Low
): BitmapPainter

Painter implementation used to draw an ImageBitmap into the provided canvas This implementation can handle applying alpha and ColorFilter to it's drawn result

Parameters
image: ImageBitmap

The ImageBitmap to draw

srcOffset: IntOffset = IntOffset.Zero

Optional offset relative to image used to draw a subsection of the ImageBitmap. By default this uses the origin of image

srcSize: IntSize = IntSize(image.width, image.height)

Optional dimensions representing size of the subsection of image to draw Both the offset and size must have the following requirements:

  1. Left and top bounds must be greater than or equal to zero

  2. Source size must be greater than zero

  3. Source size must be less than or equal to the dimensions of image

filterQuality: FilterQuality = FilterQuality.Low

Sampling algorithm applied to the image when it is scaled and drawn into the destination. The default is FilterQuality.Low which scales using a bilinear sampling algorithm