add Image9Patch
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.
Parameters
image
The image to be added
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.
Return
A string describing an error if the operation was not successful, empty otherwise.
Parameters
image Id
ID of the image.
bitmap
Bitmap data of the image.