Ink API
The requestPresenter() method of the Ink interface returns a Promise that fulfills with a DelegatedInkTrailPresenter object to handle rendering strokes.
Syntax
requestPresenter(param)
Parameters
param- : An object that contains the following property:
presentationArea- : An Element inside which rendering of ink strokes is confined (the element's border box, to be precise). If
paramis not included, orpresentationAreais set tonull, ink rendering is confined to the containing viewport by default.
- : An Element inside which rendering of ink strokes is confined (the element's border box, to be precise). If
- : An object that contains the following property:
Return value
A Promise that resolves to a DelegatedInkTrailPresenter object instance.
Exceptions
ErrorDOMException- : An error is thrown and the operation is aborted if
presentationAreais not a valid Element, or is not in the same document as the associated Ink object.
- : An error is thrown and the operation is aborted if
Example
async function inkInit() {
const ink = navigator.ink;
let presenter = await ink.requestPresenter({ presentationArea: canvas });
// …
}
Specifications
Browser compatibility
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
