createImageFromTextureSource function

FutureOr<Image> createImageFromTextureSource(
  1. JSAny object, {
  2. required int width,
  3. required int height,
  4. bool transferOwnership = false,
})

Creates a ui.Image from a valid texture source (for example HTMLImageElement | HTMLVideoElement | HTMLCanvasElement).

By default, transferOwnership specifies that the ownership of the texture will be not be transferred to the renderer, and a copy of the texture source will be made. If this is not desired, the ownership of the object can be transferred to the renderer and the engine will take ownership of the texture source and consume its contents.

Implementation

FutureOr<ui.Image> createImageFromTextureSource(JSAny object,  { required int width, required int height, bool transferOwnership = false }) {
  return renderer.createImageFromTextureSource(
    object, width: width, height: height, transferOwnership: transferOwnership
  );
}