Skip to content

Image

Image

It is used to render image content. The specific type is as follows:

ts
type Image = {
  type: 'image';
  x: number;
  y: number;
  w: number;
  h: number;
  angle: number;
  detail: {
    src: string;
  };
};

Image.detail

The basic attribute details of the element can be viewed Element's Detail # .

Image.detail Data-Type

The Data-Type of Image.detail

ts
type ImageDetail = {
  src: string;
};

Image.detail Properties

PropertyDescriptionTypeDefaultRequiredOthers
srcThe image URL or DataURLstring-true-

Complete Data Example

js
const elementImage = {
  name: 'image',
  x: 160,
  y: 100,
  w: 200,
  h: 200,
  angle: 0,
  type: 'image',
  detail: {
    src: './image/github.png'
  }
};

Demo Preview

More Demo >>