Image (image)

It is an image. You can define its size and the image that has to draw.

const image = canvasUI.view.new("image-1", "image")

image.set("size", {
  width: 100,
  height: 100,
})

image.set("src", "/img/logo.svg")
image

Properties

size

It is the size of the image. It is an object with these properties:

  • width: Width of the image.
  • height: Height of the image.

Its default value is:

{
  width: 100,
  height: 100
}

src

It is the source of the image. If the source is not defined, the value is "". Its default value is:

""

On This Page