rememberStyleImage

fun rememberStyleImage(imageId: String, imageBitmap: ImageBitmap, scale: Float? = null, sdf: Boolean = false, stretchX: List<ImageStretches> = listOf(), stretchY: List<ImageStretches> = listOf(), content: ImageContent? = null): StyleImage

Create and remember a StyleImage with ImageBitmap.

Return

a StyleImage

Parameters

imageId

the id of the image

imageBitmap

The image data of the bitmap as ImageBitmap

scale

scale factor for the image

sdf

option to treat whether image is SDF(signed distance field) or not

stretchX

An array of two-element arrays, consisting of two numbers that represent the from position and the to position of areas that can be stretched horizontally.

stretchY

An array of two-element arrays, consisting of two numbers that represent the from position and the to position of areas that can be stretched vertically.

content

An array of four numbers, with the first two specifying the left, top corner, and the last two specifying the right, bottom corner. If present, and if the icon uses icon-text-fit, the symbol's text will be fit inside the content box.


fun rememberStyleImage(key: Any?, imageId: String, painter: Painter, scale: Float? = null, sdf: Boolean = false, stretchX: List<ImageStretches> = listOf(), stretchY: List<ImageStretches> = listOf(), content: ImageContent? = null): StyleImage

Create and remember a StyleImage with painter and key.

Return

a StyleImage

Parameters

key

An optional key to be used as a key for the remembered value.

imageId

the id of the image

painter

the Painter to provide the image

scale

scale factor for the image

sdf

option to treat whether image is SDF(signed distance field) or not

stretchX

An array of two-element arrays, consisting of two numbers that represent the from position and the to position of areas that can be stretched horizontally.

stretchY

An array of two-element arrays, consisting of two numbers that represent the from position and the to position of areas that can be stretched vertically.

content

An array of four numbers, with the first two specifying the left, top corner, and the last two specifying the right, bottom corner. If present, and if the icon uses icon-text-fit, the symbol's text will be fit inside the content box.


fun rememberStyleImage(imageId: String, @DrawableRes resourceId: Int, scale: Float? = null, sdf: Boolean = false, stretchX: List<ImageStretches> = listOf(), stretchY: List<ImageStretches> = listOf(), content: ImageContent? = null): StyleImage

Create and remember a StyleImage with resourceId.

Return

a StyleImage

Parameters

imageId

the id of the image

resourceId

the resource id to be loaded to the image

scale

scale factor for the image

sdf

option to treat whether image is SDF(signed distance field) or not

stretchX

An array of two-element arrays, consisting of two numbers that represent the from position and the to position of areas that can be stretched horizontally.

stretchY

An array of two-element arrays, consisting of two numbers that represent the from position and the to position of areas that can be stretched vertically.

content

An array of four numbers, with the first two specifying the left, top corner, and the last two specifying the right, bottom corner. If present, and if the icon uses icon-text-fit, the symbol's text will be fit inside the content box.