ResourceBuilders.InlineImageResource.Builder

public final class ResourceBuilders.InlineImageResource.Builder


Builder for InlineImageResource

Summary

Public methods

@NonNull ResourceBuilders.InlineImageResource

Builds an instance from accumulated values.

@NonNull ResourceBuilders.InlineImageResource.Builder
setData(@NonNull Array<@NonNull 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 = "") @NonNull int heightPx)

Sets the native height of the image, in pixels.

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

Sets the native width of the image, in pixels.

Public methods

build

@NonNull
public ResourceBuilders.InlineImageResource build()

Builds an instance from accumulated values.

setData

@NonNull
public ResourceBuilders.InlineImageResource.Builder setData(@NonNull Array<@NonNull byte> data)

Sets the byte array representing the image.

setFormat

@NonNull
public ResourceBuilders.InlineImageResource.Builder setFormat(@ResourceBuilders.ImageFormat @NonNull 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

@NonNull
public ResourceBuilders.InlineImageResource.Builder setHeightPx(@Dimension(unit = "") @NonNull 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

@NonNull
public ResourceBuilders.InlineImageResource.Builder setWidthPx(@Dimension(unit = "") @NonNull 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.