{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

BrushPainter

public final class BrushPainter extends Painter

java.lang.Object
   ↳ androidx.compose.ui.graphics.painter.Painter
     ↳ androidx.compose.ui.graphics.painter.BrushPainter

Painter implementation used to fill the provided bounds with the specified Brush. The intrinsic size of this Painter is determined by Brush.intrinsicSize

Summary

Public constructors

Public methods

boolean
equals(Object other)
final @NonNull Brush
@NonNull Size

Return the intrinsic size of the Painter.

int
@NonNull String

Protected methods

boolean
applyAlpha(float alpha)

Apply the provided alpha value returning true if it was applied successfully, or false if it could not be applied

boolean

Apply the provided color filter returning true if it was applied successfully, or false if it could not be applied

void

Implementation of drawing logic for instances of Painter.

Inherited methods

From androidx.compose.ui.graphics.painter.Painter
boolean

Apply the appropriate internal configuration to positioning content with the given LayoutDirection

final void
orgKt.draw(
    @NonNull DrawScope receiver,
    @NonNull Size size,
    float alpha,
    ColorFilter colorFilter
)

Public constructors

BrushPainter

public BrushPainter(@NonNull Brush brush)

Public methods

equals

public boolean equals(Object other)

getBrush

public final @NonNull Brush getBrush()

getIntrinsicSize

public @NonNull Size getIntrinsicSize()

Return the intrinsic size of the Painter. If the there is no intrinsic size (i.e. filling bounds with an arbitrary color) return Size.Unspecified. If there is no intrinsic size in a single dimension, return Size with Float.NaN in the desired dimension. If a Painter does not have an intrinsic size, it will always draw within the full bounds of the destination

hashCode

public int hashCode()

toString

public @NonNull String toString()

Protected methods

applyAlpha

protected boolean applyAlpha(float alpha)

Apply the provided alpha value returning true if it was applied successfully, or false if it could not be applied

applyColorFilter

protected boolean applyColorFilter(ColorFilter colorFilter)

Apply the provided color filter returning true if it was applied successfully, or false if it could not be applied

onDraw

protected void onDraw(@NonNull DrawScope receiver)

Implementation of drawing logic for instances of Painter. This is invoked internally within draw after the positioning and configuring the Painter