Added in API level 1

PictureDrawable


open class PictureDrawable : Drawable
kotlin.Any
   ↳ android.graphics.drawable.Drawable
   ↳ android.graphics.drawable.PictureDrawable

Drawable subclass that wraps a Picture, allowing the picture to be used wherever a Drawable is supported.

Summary

Public constructors

Construct a new drawable referencing the specified picture.

Public methods
open Unit
draw(canvas: Canvas)

open Int

open Int

open Int

open Picture!

Return the picture associated with the drawable.

open Unit
setAlpha(alpha: Int)

open Unit
setColorFilter(colorFilter: ColorFilter?)

open Unit
setPicture(picture: Picture!)

Associate a picture with this drawable.

Inherited functions

Public constructors

PictureDrawable

Added in API level 1
PictureDrawable(picture: Picture!)

Construct a new drawable referencing the specified picture. The picture may be null.

Parameters
picture Picture!: The picture to associate with the drawable. May be null.

Public methods

draw

Added in API level 1
open fun draw(canvas: Canvas): Unit
Parameters
canvas Canvas: The canvas to draw into This value cannot be null.

getIntrinsicHeight

Added in API level 1
open fun getIntrinsicHeight(): Int
Return
Int the intrinsic height, or -1 if no intrinsic height

getIntrinsicWidth

Added in API level 1
open fun getIntrinsicWidth(): Int
Return
Int the intrinsic width, or -1 if no intrinsic width

getOpacity

Added in API level 1
open fun getOpacity(): Int
Return
Int int The opacity class of the Drawable. Value is android.graphics.PixelFormat#UNKNOWN, android.graphics.PixelFormat#TRANSLUCENT, android.graphics.PixelFormat#TRANSPARENT, or android.graphics.PixelFormat#OPAQUE

getPicture

Added in API level 1
open fun getPicture(): Picture!

Return the picture associated with the drawable. May be null.

Return
Picture! the picture associated with the drawable, or null.

setAlpha

Added in API level 1
open fun setAlpha(alpha: Int): Unit
Parameters
alpha Int: Value is between 0 and 255 inclusive

setColorFilter

Added in API level 1
open fun setColorFilter(colorFilter: ColorFilter?): Unit
Parameters
colorFilter ColorFilter?: The color filter to apply, or null to remove the existing color filter

setPicture

Added in API level 1
open fun setPicture(picture: Picture!): Unit

Associate a picture with this drawable. The picture may be null.

Parameters
picture Picture!: The picture to associate with the drawable. May be null.