Zebra API Doc

zebra.ui.Picture Class

Extends zebra.ui.Render

Image render. Render an image target object or specified area of the given target image object.

Constructor

zebra.ui.Picture

(
  • img
  • [x]
  • [y]
  • [w]
  • [h]
)

Parameters:

  • img Image

    the image to be rendered

  • [x] Integer optional

    a x coordinate of the rendered image part

  • [y] Integer optional

    a y coordinate of the rendered image part

  • [w] Integer optional

    a width of the rendered image part

  • [h] Integer optional

    a height of the rendered image part

Methods

getBottom

() Integer

Inherited from zebra.ui.View:

Get bottom gap. The method informs UI component that uses the view as a border view how much space bottom side of the border occupies


Return: Integer

a bottom gap

getLeft

() Integer

Inherited from zebra.ui.View:

Get left gap. The method informs UI component that uses the view as a border view how much space left side of the border occupies


Return: Integer

a left gap

getPreferredSize

() Object

Inherited from zebra.ui.View:

Return preferred size the view desires to have


Return: Object

getRight

() Integer

Inherited from zebra.ui.View:

Get right gap. The method informs UI component that uses the view as a border view how much space right side of the border occupies


Return: Integer

a right gap

getTop

() Integer

Inherited from zebra.ui.View:

Get top gap. The method informs UI component that uses the view as a border view how much space top side of the border occupies


Return: Integer

a top gap

paint

(
  • g
  • x
  • y
  • w
  • h
  • c
)

Inherited from zebra.ui.View:

The method is called to render the decorative element on the given surface of the specified UI component

Parameters:

  • g Canvas 2D context

    graphical context

  • x Integer

    x coordinate

  • y Integer

    y coordinate

  • w Integer

    required width

  • h Integer

    required height

  • c zebra.ui.Panel

    an UI component on which the view element has to be drawn

setTarget

(
  • o
)

Inherited from zebra.ui.Render:

Set the given target object. The method triggers "targetWasChanged(oldTarget, newTarget)" execution if the method is declared. Implement the method if you need to track a target object updating.

Parameters:

  • o Object

    a target object to be visualized

Attributes

height

Integer readonly

A height of the image part that has to be rendered

Default: 0

target

Object readonly

Inherited from zebra.ui.Render:

Target object to be visualized

Default: null

width

Integer readonly

A width of the image part that has to be rendered

Default: 0

x

Integer readonly

A x coordinate of the image part that has to be rendered

Default: 0

y

Integer readonly

A y coordinate of the image part that has to be rendered

Default: 0