• About MapKit
    • Getting started
  • Map styles
  • MapKit SDK versions
  • Frequently asked questions
  • Contact us

Package com.yandex.runtime.image

Class ImageProvider

java.lang.Object
    ↳ com.yandex.runtime.image.ImageProvider

abstract class ImageProvider

Provides Bitmap objects from different input sources.

Extend this class to provide images from custom sources.

Summary

Constructors

Signature and Description

ImageProvider()

ImageProvider(boolean cacheable)

Methods

Type and modifiers

Method and Description

boolean

isCacheable()
Determines whether image should be cached on GPU or not.

abstract java.lang.String

getId()
Returns the unique identifier for an image.

abstract android.graphics.Bitmap

getImage()
Returns the image in bitmap format.

static ImageProvider

fromBitmap(android.graphics.Bitmap bitmap)

static ImageProvider

fromBitmap(android.graphics.Bitmap bitmap,
           boolean cacheable,
           java.lang.String id)

Returns the image provider based on a given bitmap.

static ImageProvider

fromAsset(android.content.Context context,
          java.lang.String assetName)

static ImageProvider

fromAsset(android.content.Context context,
          java.lang.String assetName,
          boolean cacheable)

Returns the image provider based on a given asset (from the assets/ folder).

static ImageProvider

fromResource(android.content.Context context,
             int resourceId)

static ImageProvider

fromResource(android.content.Context context,
             int resourceId,
             boolean cacheable)

Returns the image provider based on an application resource (from the res/ folder).

static ImageProvider

fromFile(java.lang.String fileName)

static ImageProvider

fromFile(java.lang.String fileName,
         boolean cacheable)

Returns the image provider based on an image file from the internal storage.

Constuctors

ImageProvider

ImageProvider()


ImageProvider

ImageProvider(boolean cacheable)


Methods

isCacheable

boolean isCacheable()

Determines whether image should be cached on GPU or not.


getId

java.lang.String getId()

Returns the unique identifier for an image.

Providers can be cached based on it.


getImage

android.graphics.Bitmap getImage()

Returns the image in bitmap format.


fromBitmap

ImageProvider fromBitmap(android.graphics.Bitmap bitmap)


fromBitmap

ImageProvider fromBitmap(android.graphics.Bitmap bitmap,
                         boolean cacheable,
                         java.lang.String id)

Returns the image provider based on a given bitmap.


fromAsset

ImageProvider fromAsset(android.content.Context context,
                        java.lang.String assetName)


fromAsset

ImageProvider fromAsset(android.content.Context context,
                        java.lang.String assetName,
                        boolean cacheable)

Returns the image provider based on a given asset (from the assets/ folder).


fromResource

ImageProvider fromResource(android.content.Context context,
                           int resourceId)


fromResource

ImageProvider fromResource(android.content.Context context,
                           int resourceId,
                           boolean cacheable)

Returns the image provider based on an application resource (from the res/ folder).


fromFile

ImageProvider fromFile(java.lang.String fileName)


fromFile

ImageProvider fromFile(java.lang.String fileName,
                       boolean cacheable)

Returns the image provider based on an image file from the internal storage.