ResourceBuilders.InlineImageResource.Builder


class ResourceBuilders.InlineImageResource.Builder


Builder for InlineImageResource

Summary

Public constructors

Creates an instance of Builder.

Public functions

ResourceBuilders.InlineImageResource

Builds an instance from accumulated values.

ResourceBuilders.InlineImageResource.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setData(data: ByteArray)

Sets the byte array representing the image.

ResourceBuilders.InlineImageResource.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setFormat(format: Int)

Sets the format of the byte array data representing the image.

ResourceBuilders.InlineImageResource.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setHeightPx(heightPx: @Dimension(unit = 1) Int)

Sets the native height of the image, in pixels.

ResourceBuilders.InlineImageResource.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setWidthPx(widthPx: @Dimension(unit = 1) Int)

Sets the native width of the image, in pixels.

Public constructors

Builder

Added in 1.0.0
Builder()

Creates an instance of Builder.

Public functions

build

Added in 1.0.0
fun build(): ResourceBuilders.InlineImageResource

Builds an instance from accumulated values.

setData

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setData(data: ByteArray): ResourceBuilders.InlineImageResource.Builder

Sets the byte array representing the image.

setFormat

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setFormat(format: Int): ResourceBuilders.InlineImageResource.Builder

Sets the format of the byte array data representing the image. May be left unspecified or set to IMAGE_FORMAT_UNDEFINED in which case the platform will attempt to extract this from the raw image data. If the platform does not support the format, the image will not be decoded or displayed.

setHeightPx

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setHeightPx(heightPx: @Dimension(unit = 1) Int): ResourceBuilders.InlineImageResource.Builder

Sets the native height of the image, in pixels. Only required for formats (e.g. IMAGE_FORMAT_RGB_565) where the image data does not include size.

setWidthPx

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
fun setWidthPx(widthPx: @Dimension(unit = 1) Int): ResourceBuilders.InlineImageResource.Builder

Sets the native width of the image, in pixels. Only required for formats (e.g. IMAGE_FORMAT_RGB_565) where the image data does not include size.