Package com. mapbox. maps. extension. style. image
Types
Image Extension Impl
Link copied to clipboard
class ImageExtensionImpl(builder: ImageExtensionImpl.Builder) : StyleContract.StyleImageExtension
Content copied to clipboard
Concrete implementation of ImagePlugin, the plugin is used to add an image to be used in the style.
Image Nine Patch Extension Impl
Link copied to clipboard
class ImageNinePatchExtensionImpl(builder: ImageNinePatchExtensionImpl.Builder) : StyleContract.StyleImageExtension
Content copied to clipboard
Concrete implementation of ImagePlugin (see ImageExtensionImpl) but taking 9-patch Bitmap in order to calculate stretchX, stretchY and paddings automatically.
Nine Patch Image
Link copied to clipboard
data class NinePatchImage(internalImage: Image, stretchX: List<ImageStretches>, stretchY: List<ImageStretches>, imageContent: ImageContent)
Content copied to clipboard
Data class describing 9-patch bitmap.
Functions
add Image
Link copied to clipboard
Extension function to add an image provided by the Style Extension to the Style.
add Image9Patch
Link copied to clipboard
fun StyleInterface.addImage9Patch(image: StyleContract.StyleImageExtension)
Content copied to clipboard
Extension function to add 9-patch image provided by the Style Extension to the Style.
fun StyleInterface.addImage9Patch(imageId: String, bitmap: Bitmap, scale: Float = pixelRatio, sdf: Boolean = false): Expected<String, None>
Content copied to clipboard
Adds an 9-patch image to be used in the style. X-stretches, Y-stretches and padding will be calculated from Bitmap.getNinePatchChunk.
image
Link copied to clipboard
fun image(imageId: String, block: ImageExtensionImpl.Builder.() -> Unit): ImageExtensionImpl
Content copied to clipboard
DSL function for ImageExtensionImpl.
image9Patch
Link copied to clipboard
fun image9Patch(imageId: String, bitmap: Bitmap, block: ImageNinePatchExtensionImpl.Builder.() -> Unit? = null): ImageNinePatchExtensionImpl
Content copied to clipboard
DSL function for ImageNinePatchExtensionImpl.
parse9Patch Bitmap
Link copied to clipboard
Utility function returning NinePatchImage from a given Bitmap.