It is an area in which there is an image inside. You can define the background color, the image, the size of the area...
const imageArea = canvasUI.composite.new("imageArea-1", "imageArea") imageArea.set("size", { width: { unit: "px", value: 200 }, height: { unit: "px", value: 200 }, }) imageArea.set("imageSize", { width: 100, height: 100 }) imageArea.set("imageSrc", "/img/logo.svg") imageArea.set("background", "#F9BC41") imageArea.set("border", { size: 10, color: "#E0A93B" }) imageArea.set("corner", { type: "round", size: 10 })
It is the size of the composite. It is an object with these properties:
Each of these properties can be "auto"
to make the size adapt to the size of its image, and it can also be an object with these properties:
"px"
and "%"
.If the unit is "px"
the value will be in px. If it is "%"
the value will be the percentage of its maximum available size.
Its default value is:
{ width: "auto", height: "auto" }
It is the size of the image. It is an object with these properties:
Its default value is:
{ width: 100, height: 100 }
It is the source of the image. If the source is not defined, the value is ""
. Its default value is:
""
It is the background color of the composite. Its default value is
"rgba(0,0,0,0)"
It is the border of the composite. It is an object with these properties:
Its default value is:
{ size: 0, color: "#000" }
It defines how the corners are drawn. It is an object with these properties:
"cut"
to define that the corners have to be cut, and it can also be "round"
to define that the corners have to be rounded.Its default value is:
{ type: "cut", size: 0 }
It is used to align the image inside the area. It is an object with these properties:
"left"
, "middle"
and "right"
."top"
, "middle"
and "bottom"
.Its default value is:
{ horizontal: "middle", vertical: "middle" }
It is the margin of the image in its area. It is an object with these properties:
Its default value is:
{ top: 0, right: 0, bottom: 0, left: 0 }