Skip to main content

BitmapDrawable

declare class BitmapDrawable {}

BitmapDrawable

Instance Method

constructor

declare class BitmapDrawable {
constructor();
constructor(bitmap: Bitmap)
}
  • Description

    Create a new BitmapDrawable

getBitmap

declare class BitmapDrawable {
getBitmap(): Bitmap
}
  • Description

    Returns the bitmap used by this drawable to render.

setBitmap

declare class BitmapDrawable {
setBitmap(bitmap: Bitmap): void
}
  • Description

    Switch to a new Bitmap object.

setGravity

declare class BitmapDrawable {
setGravity(gravity: number): void
}
  • Description

    Set the gravity used to position/stretch the bitmap within its bounds.

draw

declare class BitmapDrawable {
draw(canvas: Canvas): void
}
  • Description

    Draw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha) and color filter (set via setColorFilter).

setAlpha

declare class BitmapDrawable {
setAlpha(alpha: number): void
}
  • Description

    Specify an alpha value for the drawable.

onBoundsChange

declare class BitmapDrawable {
onBoundsChange(bounds: Rect): void
}
  • Description

    Override this in your subclass to change appearance if you vary based on the bounds.

copyBounds

declare class BitmapDrawable {
copyBounds() : Rect
}
  • Description

    Return a copy of the drawable's bounds in a new Rect.

copyBounds

declare class BitmapDrawable {
copyBounds(bounds: Rect): void
}
  • Description

    Return a copy of the drawable's bounds in the specified Rect (allocated by the caller).

getMinimumWidth

declare class BitmapDrawable {
getMinimumWidth(): number
}
  • Description

    Returns the minimum width suggested by this Drawable.

getMinimumHeight

declare class BitmapDrawable {
getMinimumHeight(): number
}
  • Description

    Returns the minimum height suggested by this Drawable.

getBounds

declare class BitmapDrawable {
getBounds(): Rect
}
  • Description

    Return the drawable's bounds Rect.

getOutline

declare class BitmapDrawable {
getOutline(outline:Outline):void
}
  • Description

    Called to get the drawable to populate the Outline that defines its drawing area.

getCallback

declare class BitmapDrawable {
getCallback() :Drawable.Callback
}
  • Description

    Return the current Callback implementation attached to this Drawable.

getIntrinsicWidth

declare class BitmapDrawable {
getIntrinsicWidth(): number
}
  • Description

    Returns the drawable's intrinsic width.

getIntrinsicHeight

declare class BitmapDrawable {
getIntrinsicHeight():number
}
  • Description

    Returns the drawable's intrinsic height.

setBounds

declare class BitmapDrawable {
setBounds(bounds: Rect): void;
setBounds(left: number, top: number, right: number, bottom: number): void;
}
  • Description

    Specify a bounding rectangle for the Drawable.

setCallback

declare class BitmapDrawable {
setCallback(callback: Drawable.Callback): void
}
  • Description

    Bind a Callback object to this Drawable.