Mobile Document Scanner API Reference / RasterImage
Interface: RasterImage
Defined in: src/results.ts:79
A bitmap image, such as a photo from the camera or an imported image.
Extends
Properties
height
readonlyheight:number
Defined in: src/results.ts:57
The height of the image, in the units of width.
Inherited from
kind
readonlykind:"raster"
Defined in: src/results.ts:80
width
readonlywidth:number
Defined in: src/results.ts:55
The width of the image, in pixels for a raster image, or in points for a vector image.
Inherited from
Methods
toBlob()
toBlob(
encoding?):Promise<Blob>
Defined in: src/results.ts:75
Get the image as a blob. The document scanner draws a vector image as pixels first.
Parameters
encoding?
The format of the blob. Without it, original gives the blob that the page arrived as, and processed gives a PNG image.
Returns
Promise<Blob>
The encoded image.
Inherited from
toCanvas()
toCanvas(
options?):Promise<HTMLCanvasElement>
Defined in: src/results.ts:65
Draw the image on a new canvas.
Parameters
options?
The canvas is scale times the size of the image. scale is 1 by default.
scale?
number
Returns
Promise<HTMLCanvasElement>
The canvas, with the image drawn on it.