makeImage method

HTMLImageElement? makeImage([
  1. ImageRendererOptions? options
])

Create an HTMLImageElement that contains a bitmap of the current Diagram. This method is just a convenience function that creates an image, sets its source to the returned string of #makeImageData, and returns a reference to that Image.

See #makeImageData for a complete explanation of possible options.

By default this method returns a snapshot of the visible diagram, but optional arguments give more options.

Note that a returned HTMLImageElement, either returned directly or passed to the callback function, might not yet have the complete property set to true. So if you need to draw the image immediately, you should check that property first. If it is false, add a "load" listener to the HTMLImageElement that does the drawing you want.

At the current time methods such as Diagram#makeImage, Diagram#makeImageData and Diagram#makeSvg do not work on Overviews.

For the rendering to work, the diagram must have an HTML Div element as the #div. @param {any=} options a JavaScript object detailing optional arguments for image creation, to be passed to #makeImageData. @return {HTMLImageElement | null} An HTML Image element, or null if a callback is specified, or null if there is no DOM. @see #makeImageData @see #makeSvg

Implementation

_i6.HTMLImageElement? makeImage([_i3.ImageRendererOptions? options]) =>
    _i4.callMethod(
      this,
      'makeImage',
      [options ?? _i5.undefined],
    );