Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/ext/canvas/lib.deno_canvas.d.ts>createImageBitmap

A modern runtime for JavaScript and TypeScript.
Latest
function createImageBitmap
import { createImageBitmap } from "https://deno.land/x/deno@v2.0.4/ext/canvas/lib.deno_canvas.d.ts";

Create a new ImageBitmap object from a given source.

Parameters

The image to create an ImageBitmap from.

optional
options: ImageBitmapOptions

The options for creating the ImageBitmap.

Create a new ImageBitmap object from a given source, cropping to the specified rectangle.

Parameters

The image to create an ImageBitmap from.

sx: number

The x coordinate of the top-left corner of the sub-rectangle from which the ImageBitmap will be cropped.

sy: number

The y coordinate of the top-left corner of the sub-rectangle from which the ImageBitmap will be cropped.

sw: number

The width of the sub-rectangle from which the ImageBitmap will be cropped.

sh: number

The height of the sub-rectangle from which the ImageBitmap will be cropped.

optional
options: ImageBitmapOptions

The options for creating the ImageBitmap.