🌈 Create new beautiful Compose Gradients with our new wesite ->
Class

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

Source set: Common
public class BitmapPainter(
    private val image: ImageBitmap,
    private val srcOffset: IntOffset = IntOffset.Zero,
    private val srcSize: IntSize = IntSize(image.width, image.height),
) : Painter()

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 The ImageBitmap to draw
srcOffset Optional offset relative to image used to draw a subsection of the ImageBitmap. By default this uses the origin of image
srcSize 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

Properties

intrinsicSize

Source set: Common
override val intrinsicSize: Size

Return the dimension of the underlying ImageBitmap as it's intrinsic width and height

Functions

onDraw

Source set: Common
override fun DrawScope.onDraw()

applyAlpha

Source set: Common
override fun applyAlpha(alpha: Float): Boolean

applyColorFilter

Source set: Common
override fun applyColorFilter(colorFilter: ColorFilter?): Boolean

equals

Source set: Common
override fun equals(other: Any?): Boolean

hashCode

Source set: Common
override fun hashCode(): Int

toString

Source set: Common
override fun toString(): String