ResourceBuilders.InlineImageResource.Builder

public final class ResourceBuilders.InlineImageResource.Builder


Builder for InlineImageResource

Summary

Public constructors

Public methods

@NonNull ResourceBuilders.InlineImageResource

Builds an instance from accumulated values.

@NonNull ResourceBuilders.InlineImageResource.Builder
setData(byte[] data)

Sets the byte array representing the image.

@NonNull ResourceBuilders.InlineImageResource.Builder

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

@NonNull ResourceBuilders.InlineImageResource.Builder
setHeightPx(@Dimension(unit = "") int heightPx)

Sets the native height of the image, in pixels.

@NonNull ResourceBuilders.InlineImageResource.Builder
setWidthPx(@Dimension(unit = "") int widthPx)

Sets the native width of the image, in pixels.

Public constructors

Builder

public Builder()

Public methods

build

public @NonNull ResourceBuilders.InlineImageResource build()

Builds an instance from accumulated values.

setData

public @NonNull ResourceBuilders.InlineImageResource.Builder setData(byte[] data)

Sets the byte array representing the image.

setFormat

public @NonNull ResourceBuilders.InlineImageResource.Builder setFormat(@ResourceBuilders.ImageFormat int format)

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

public @NonNull ResourceBuilders.InlineImageResource.Builder setHeightPx(@Dimension(unit = "") int heightPx)

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

public @NonNull ResourceBuilders.InlineImageResource.Builder setWidthPx(@Dimension(unit = "") int widthPx)

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.