ResourceBuilders.InlineImageResource.Builder


public final class ResourceBuilders.InlineImageResource.Builder


Builder for InlineImageResource

Summary

Public constructors

Creates an instance of Builder.

Public methods

@NonNull ResourceBuilders.InlineImageResource

Builds an instance from accumulated values.

@NonNull ResourceBuilders.InlineImageResource.Builder
@RequiresSchemaVersion(major = 1, minor = 0)
setData(@NonNull byte[] data)

Sets the byte array representing the image.

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

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

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

Sets the native height of the image, in pixels.

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

Sets the native width of the image, in pixels.

Public constructors

Builder

Added in 1.0.0
public Builder()

Creates an instance of Builder.

Public methods

build

Added in 1.0.0
public @NonNull ResourceBuilders.InlineImageResource build()

Builds an instance from accumulated values.

setData

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull ResourceBuilders.InlineImageResource.Builder setData(@NonNull byte[] data)

Sets the byte array representing the image.

setFormat

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull ResourceBuilders.InlineImageResource.Builder setFormat(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

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull ResourceBuilders.InlineImageResource.Builder setHeightPx(@Dimension(unit = 1) 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

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull ResourceBuilders.InlineImageResource.Builder setWidthPx(@Dimension(unit = 1) 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.