Skip to content

Class iDraw

Arguments

js
import { iDraw } from 'idraw';
const dom = document.querySelector('#app');
const options = {
  width: 600,
  height: 400,
  devicePixelRatio: 2
};

const idraw = new iDraw(dom, options);
ArugmentDescriptionTypeDefaultRequiredOthers
domCanvas mounted DOMHTMLDivElement-true-
optionsImage rendering options[Object]-true-

Options

ts
type Options = {
  width: number;
  height: number;
  devicePixelRatio: number;
};

Options Properties

PropertyDescriptionTypeDefaultRequiredOthers
widthDrawing board's widthnumber-true-
heightDrawing board's heightnumber-true-
devicePixelRatioDevice pixel scalenumber1false-

Options Preivew

More Demo >>