ImagePainter

@Stable
class ImagePainter : Painter, RememberObserver

A Painter that asynchronously executes ImageRequests and draws the result. Instances can only be created with rememberImagePainter.

Types

ExecuteCallback
Link copied to clipboard
fun interface ExecuteCallback

Invoked immediately before the ImagePainter executes a new image request. Return 'true' to proceed with the request. Return 'false' to skip executing the request.

Snapshot
Link copied to clipboard
@ExperimentalCoilApi
data class Snapshot(state: ImagePainter.State, request: ImageRequest, size: Size)

A snapshot of the ImagePainter's properties.

State
Link copied to clipboard
@ExperimentalCoilApi
sealed class State

The current state of the ImagePainter.

Functions

draw
Link copied to clipboard
fun DrawScope.draw(size: Size, alpha: Float, colorFilter: ColorFilter?)
onAbandoned
Link copied to clipboard
open override fun onAbandoned()
onForgotten
Link copied to clipboard
open override fun onForgotten()
onRemembered
Link copied to clipboard
open override fun onRemembered()

Properties

imageLoader
Link copied to clipboard
var imageLoader: ImageLoader

The current ImageLoader.

intrinsicSize
Link copied to clipboard
open override val intrinsicSize: Size
request
Link copied to clipboard
var request: ImageRequest

The current ImageRequest.

state
Link copied to clipboard
var state: ImagePainter.State

The current ImagePainter.State.