# setImage

public final void setImage(ImageSource imageSource)

Set the image source from a bitmap, resource, asset, file or other URI.

#### Parameters

imageSource

Image source.

public final void setImage(ImageSource imageSource, ImageViewState state)

Set the image source from a bitmap, resource, asset, file or other URI, starting with a given orientation setting, scale and center. This is the best method to use when you want scale and center to be restored after screen orientation change; it avoids any redundant loading of tiles in the wrong orientation.

#### Parameters

imageSource

Image source.

state

State to be restored. Nullable.

public final void setImage(ImageSource imageSource, ImageSource previewSource)

Set the image source from a bitmap, resource, asset, file or other URI, providing a preview image to be displayed until the full size image is loaded.

You must declare the dimensions of the full size image by calling dimensions on the imageSource object. The preview source will be ignored if you don't provide dimensions, and if you provide a bitmap for the full size image.

#### Parameters

imageSource

Image source. Dimensions must be declared.

previewSource

Optional source for a preview image to be displayed and allow interaction while the full size image loads.

public final void setImage(ImageSource imageSource, ImageSource previewSource, ImageViewState state)

Set the image source from a bitmap, resource, asset, file or other URI, providing a preview image to be displayed until the full size image is loaded, starting with a given orientation setting, scale and center. This is the best method to use when you want scale and center to be restored after screen orientation change; it avoids any redundant loading of tiles in the wrong orientation.

You must declare the dimensions of the full size image by calling dimensions on the imageSource object. The preview source will be ignored if you don't provide dimensions, and if you provide a bitmap for the full size image.

#### Parameters

imageSource

Image source. Dimensions must be declared.

previewSource

Optional source for a preview image to be displayed and allow interaction while the full size image loads.

state

State to be restored. Nullable.