Skip to content

KBE3D / KBCore / Cesium / getImagePixels

函数: getImagePixels()

getImagePixels(image: HTMLImageElement | ImageBitmap, width: number, height: number): ImageData

Extract a pixel array from a loaded image. Draws the image into a canvas so it can read the pixels back.

参数

image

The image to extract pixels from.

HTMLImageElement | ImageBitmap

width

number

The width of the image. If not defined, then image.width is assigned.

height

number

The height of the image. If not defined, then image.height is assigned.

返回

ImageData

The pixels of the image.

KBE3D @3.0.0 Copyright © 2024-present KBE3D