image

package
v0.1.122 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 12 Imported by: 0

README

Image Composable

@Composable
@NonRestartableComposable
fun Image(
    imageVector: ImageVector,
    contentDescription: String?,
    modifier: Modifier = Modifier,
    alignment: Alignment = Alignment.Center,
    contentScale: ContentScale = ContentScale.Fit,
    alpha: Float = DefaultAlpha,
    colorFilter: ColorFilter? = null
): Unit

@Composable
fun Image(
    painter: Painter,
    contentDescription: String?,
    modifier: Modifier = Modifier,
    alignment: Alignment = Alignment.Center,
    contentScale: ContentScale = ContentScale.Fit,
    alpha: Float = DefaultAlpha,
    colorFilter: ColorFilter? = null
): Unit

@Composable
@NonRestartableComposable
fun Image(
    bitmap: ImageBitmap,
    contentDescription: String?,
    modifier: Modifier = Modifier,
    alignment: Alignment = Alignment.Center,
    contentScale: ContentScale = ContentScale.Fit,
    alpha: Float = DefaultAlpha,
    colorFilter: ColorFilter? = null,
    filterQuality: FilterQuality = DefaultFilterQuality
): Unit

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Composable

type Composable = api.Composable

func Image

func Image(imageResource ImageResource, options ...ImageOption) Composable

type Composer

type Composer = api.Composer

type ImageOption

type ImageOption func(*ImageOptions)

func WithAlignment

func WithAlignment(alignment size.Alignment) ImageOption

func WithAlpha

func WithAlpha(alpha float32) ImageOption

func WithContentScale

func WithContentScale(contentScale uilayout.ContentScale) ImageOption

func WithModifier

func WithModifier(m ui.Modifier) ImageOption

type ImageOptions

type ImageOptions struct {
	Modifier     ui.Modifier
	Alignment    size.Alignment
	ContentScale uilayout.ContentScale
	Alpha        float32
}

func DefaultImageOptions

func DefaultImageOptions() ImageOptions

type ImageResource

type ImageResource = graphics.ImageResource

type ImageWidget

type ImageWidget struct {
	// Src is the image to display.
	Src paint.ImageOp
	// ContentScale specifies how to scale the image to the constraints.
	ContentScale layout.ContentScale
	// Alignment specifies where to position the image within the constraints.
	Alignment size.Alignment
	// Alpha applies opacity to the image (0.0 to 1.0).
	Alpha float32
}

ImageWidget is a widget that displays an image with scaling, alignment, and opacity.

func (ImageWidget) Layout

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL