Skip to main content

PictureDrawable

declare class PictureDrawable extends BitmapDrawable {}

PictureDrawable

Instance Method

constructor

declare class PictureDrawable {
constructor(url: string): void;
}
  • Description

    Create a new PictureDrawable.

invalidate

declare class PictureDrawable {
invalidate() : void;
}
  • Description

    Redraw the current Drawable.

setGravity

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

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

addOnLoaded

declare class PictureDrawable {
addOnLoaded(notify: Consumer<Picture.PictureStatus>): void;
}
  • Description

    Picture loaded notify.

draw

declare class PictureDrawable {
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 PictureDrawable {
setAlpha(alpha: number): void;
}
  • Description

    Specify an alpha value for the drawable.

onBoundsChange

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

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

copyBounds

declare class PictureDrawable {
copyBounds() : Rect;
}
  • Description

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

copyBounds

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

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

getMinimumWidth

declare class PictureDrawable {
getMinimumWidth(): number;
}
  • Description

    Returns the minimum width suggested by this Drawable.

getMinimumHeight

declare class PictureDrawable {
getMinimumHeight(): number;
}
  • Description

    Returns the minimum height suggested by this Drawable.

getBounds

declare class PictureDrawable {
getBounds(): Rect;
}
  • Description

    Return the drawable's bounds Rect.

getOutline

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

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

getCallback

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

    Return the current Callback implementation attached to this Drawable.

getIntrinsicWidth

declare class PictureDrawable {
getIntrinsicWidth(): number;
}
  • Description

    Returns the drawable's intrinsic width.

getIntrinsicHeight

declare class PictureDrawable {
getIntrinsicHeight():number;
}
  • Description

    Returns the drawable's intrinsic height.

setBounds

declare class PictureDrawable {
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 PictureDrawable {
setCallback(callback: Drawable.Callback): void;
}
  • Description

    Bind a Callback object to this Drawable.